IBM DB2 Spatial Reader Parameters
Database Connection
This is the ODBC Ddata Source Name (DSN) as configured using the DB2 client software.
Enter the username and password to access the database, user account, or wherever authentication is required.
Note: If the username and password are already set as part of the ODBC DSN entry, there is no need to re-enter the username and password here.
When enabled, the database connection persists for the duration of an FME session.
For example, it may be desirable to maintain a connection when running a batch of 100 workspaces on the same database connection, which saves the processing time required to make and break a database connection.
FME considers the database connection to be the same when the database name, the username, and password are the same.
The time (seconds) after which to terminate a query to the database if it has not yet returned a connection/result.
If it is set to 0, there is no timeout. The default is 30.
If this parameter is unset, then Table List will show tables from the current schema associated with the DSN entry.
If this parameter is set, then Table List will show tables from all the selected schemas.
This parameter is also present in the Navigator Pane, where it specifies the schemas on which the Merge Filter operates.
Constraints
After you have specified the database connection, click the Browse button to select tables to import. A connection window appears while the system retrieves the table list from the database.
Once the table list appears, you can select one or more tables, and then click OK to dismiss the window. The table name(s) will appear in the Table List field.
Enter any SQL WHERE clause that constrains the row selection in tables chosen in the Table List (for example, NUMLANES=2).
Schema Attributes
Use this parameter to expose Format Attributes in Workbench when you create a workspace:
- In a dynamic scenario, it means these attributes can be passed to the output dataset at runtime.
- In a non-dynamic scenario, you can use this parameter to expose additional attributes on multiple feature types.
Use Search Envelope
Using the minimum and maximum x and y parameters, define a bounding box that will be used to filter the input features. Only features that intersect with the bounding box are returned.
If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.
When selected, this parameter removes any portions of imported features being read that are outside the Search Envelope.
The example below illustrates the results of the Search Envelope when Clip to Search Envelope is not selected (set to No) and when it is selected (set to Yes).
- No: Any features that cross the search envelope boundary will be read, including the portion that lies outside of the boundary.
- Yes: Any features that cross the search envelope boundary will be clipped at the boundary, and only the portion that lies inside the boundary will be read. The underlying function for the Clip to Search Envelope function is an intersection; however, when Clip to Search Envelope is selected, a clipping operation is also performed in addition to the intersection.
The type of spatial relationship that must exist between the search envelope and the geometry in the target layer. Any supported relationship, in combination with Result of Spatial Comparison, can be used to filter the features being read.
For example, consider the following settings:
Spatial Relationship to Search Envelope = ST_Intersects
Result of Spatial Comparison = False
This would result in a spatial filter using DB2 Spatial’s native spatial function
DB2GSE.ST_Intersects( g1 geometry, g2 geometry) = 0
where g1 is the search envelope and g2 is the target feature. This will cause FME to return only those features that satisfy the spatial relationship above.
The following table lists the valid spatial relationships.
Search Method |
Description |
ST_CONTAINS |
Determines whether the search envelope is completely contained by the target feature. |
ST_CROSSES |
Determines whether the intersection of search envelope and the target feature results in a geometry object whose dimension is one less than the maximum dimension of the source geometries. Also determines if the intersection object contains points that are interior to both source geometries and are not equal to either of the source objects. |
ST_DISJOINT |
Determines whether the intersection of search envelope with the target feature is an empty set. |
ST_EQUALS |
Determines whether the search envelope and target feature are of the same type and have identical x,y coordinate values. |
ST_INTERSECTS |
Determines whether the intersection of search envelope and target feature does not result in an empty set. This is the exact opposite of DISJOINT. |
ST_ORDERINGEQUALS |
Determines whether the search envelope and target feature are equal and the coordinates are in the same order. |
ST_OVERLAPS |
Determines whether the search envelope and target feature overlap each other. |
ST_TOUCHES |
Determines whether any of the points common to search envelope and target feature intersect the interiors of both geometries. At least one geometry must be a linestring, polygon, multilinestring, multipolygon. |
ST_WITHIN |
Determines whether the target feature is completely within the search envelope. This is exactly opposite to CONTAINS. |
For more details, refer to the IBM DB2 Spatial Extender User’s Guide and Reference.
The result to be used for the relationship specified in Spatial Relationship to Search Envelope.
Advanced
This parameter allows for the execution of SQL statements before opening a table for reading. For example, it may be necessary to create a temporary view before attempting to read from it.
Multiple SQL commands can be delimited by a character specified using the FME_SQL_DELIMITER
directive, embedded at the beginning of the SQL block. The single character following this directive will be used to split the SQL block into SQL statements, which will then be sent to the database for execution. Note: Include a space before the character.
For example:
FME_SQL_DELIMITER ; DELETE FROM instructors; DELETE FROM people WHERE LastName='Doe' AND FirstName='John'
Multiple delimiters are not allowed and the delimiter character will be stripped before being sent to the database.
Any errors occurring during the execution of these SQL statements will normally terminate the reader or writer (depending on where the SQL statement is executed) with an error. If the specified statement is preceded by a hyphen (“-”), such errors are ignored.
This parameter allows for the execution of SQL statements after a set of tables has been read. For example, it may be necessary to clean up a temporary view after creating it.
Multiple SQL commands can be delimited by a character specified using the FME_SQL_DELIMITER
directive, embedded at the beginning of the SQL block. The single character following this directive will be used to split the SQL block into SQL statements, which will then be sent to the database for execution. Note: Include a space before the character.
For example:
FME_SQL_DELIMITER ; DELETE FROM instructors; DELETE FROM people WHERE LastName='Doe' AND FirstName='John'
Multiple delimiters are not allowed and the delimiter character will be stripped before being sent to the database.
Any errors occurring during the execution of these SQL statements will normally terminate the reader or writer (depending on where the SQL statement is executed) with an error. If the specified statement is preceded by a hyphen (“-”), such errors are ignored.
Whether multiple geometry or aggregate features with one member are read as stored or simplified and read as single member. For example, if Yes, an aggregate of points or multipoint features with only one point will be returned as a simple point.