Reader Directives

The directives that are processed by the Ingres Spatial reader are listed below. The suffixes shown are prefixed by the current <ReaderKeyword>_ in a mapping file. By default, the <ReaderKeyword> for the Ingres Spatial reader is COM.ACTIAN.INGRES.INGRES.

DATASET/DATABASE

This directive specifies the name of the Ingres database. The database must exist in the RDBMS.

Required/Optional

Required

Mapping File Syntax

INGRES_DATASET testdb

Workbench Parameter

Source Ingres Dataset

HOST

This directive specifies the machine running the Ingres RDBMS as either an IP address or host name. The database must have proper permissions and be set up to accept TCP/IP connections through the Ingres Data Access Server.

Required/Optional

Required

Mapping File Syntax

INGRES_HOST myserver

Workbench Parameter

Host

PORT

When connecting remotely, this directive specifies the Ingres Data Access Server port on which to connect to the RDBMS service.

The default port is II7.

Required/Optional

Required

Mapping File Syntax

INGRES_PORT II7

Workbench Parameter

Port

USER_NAME

The name of user who will access the database. The named user must exist with appropriate Ingres permissions.

The default user name is ingres.

Required/Optional

Required

Mapping File Syntax

INGRES_USER_NAME ingres

Workbench Parameter

Username

PASSWORD

The password of the user accessing the database.

Required/Optional

Required

Mapping File Syntax

INGRES_PASSWORD secret

Workbench Parameter

Password

DEF

The syntax of the definition is:

INGRES_DEF <tableName> \

[ingres_where_clause <whereClause>] \

[<fieldName> <fieldType>] +

OR

INGRES_DEF <queryName> \

[ingres_sql_statement <sqlQuery>]

The <tableName> must match an Ingres table in the database. This will be used as the feature type of all the features read from the table. The exception to this rule is when using the sql_statement directive. In this case, the DEF name may be any valid alphabetic identifier; it does not have to be an existing table name – rather, it is an identifier for the custom SQL query. The feature type of all the features returned from the SQL query are given the query name.

The <fieldType> of each field must be given, but it is not verified against the database definition for the field. In effect, it is ignored.

The exception to this is the geometry field type which is not placed in the DEF. This is stored separately in the geometry_columns table of the Ingres database which maps geometry information to the database and table name.

The definition allows specification of separate search parameters for each table. If any of the configuration parameters are given, they will override, for that table, whatever global values have been specified by the reader directives listed above. If any of these parameters is not specified, the global values will be used.

The following table summarizes the definition line configuration parameters:

Parameter

Contents

where_clause

This specifies the SQL WHERE clause applied to the attributes of the layer’s features to limit the set of features returned. If this is not specified, then all the tuples are returned. This directive will be ignored if the sql_statement is present.

sql_statement

This specifies an SQL SELECT query to be used as the source for the results. If this is specified, the Ingres reader will execute the query, and use the resulting rows as the features instead of reading from the table <queryName>. All returned features will have a feature type of <queryName>, and attributes for all columns selected by the query.

All parameters that specify a spatial constraint are ignored if an sql_statement is supplied.

If selecting a geometry column from an Ingres table, avoid the use of geometry column format modifiers such as AsBinary(), AsText(), AsWKT(), or ASWKB() since this obscures the fact that we have a geometry column and not just some text or byte attribute column.

If no <whereClause> is specified, all rows in the table will be read and returned as individual features. If a <whereClause> is specified, only those rows that are selected by the clause will be read. Note that the <whereClause> does not include the word “where”.

The Ingres reader allows one to use the sql_statement parameter to specify an arbitrary SQL SELECT query on the DEF line. If this is specified, FME will execute the query, and use each row of data returned from the query to define a feature. Each of these features will be given the feature type named in the DEF line, and will contain attributes for every column returned by the SELECT. In this case, all DEF line parameters regarding a WHERE clause or spatial querying are ignored, as it is possible to embed this information directly in the text of the <sqlQuery>.

The following example selects rows from the table ROADS, placing the resulting data into FME features with a feature type of MYROADS. Imagine that ROADS defines the geometry for the roads, and has a numeric field named ID, a text field named NAME and a geometry column named GEOM.

INGRES_DEF MYROADS \
	sql_statement ‘SELECT id, name, geom FROM ROADS’

Required/Optional

Required

IDs

This optional specification is used to limit the available and defined database tables files that will be read.

If no IDs are specified, then FME uses DEFs to determine which tables to read. The syntax of the IDs directive is:

INGRES_IDs <featureType1> \
	<featureType2>	\
	<featureTypeN> 

The feature types must match those used in DEF lines.

The example below selects only the ROADS table for input during a translation:

INGRES_IDs ROADS

Required/Optional

Optional

MINX, MINY, MAXX, MAXY

These directives when used together specify the spatial extent of the feature retrieval. Only features that interact with the bounding box defined by these directive values are returned.

If this is not supplied, all features will be returned. If either min value is greater than the corresponding max value, the values will be swapped. If less than the entire set of four values are supplied, the supplied values will be ignored and all features will be returned.

The syntax of the directives is:

INGRES_IN_MINX <minX>
INGRES_IN_MINY <minY>
INGRES_IN_MAXX <maxX>
INGRES_IN_MAXY <maxY>

The example below selects a small area for extraction:

INGRES_IN_MINX 25.6
INGRES_IN_MINY 59.0
INGRES_IN_MAXX 79.2
INGRES_IN_MAXY 124.5

Required/Optional

Optional

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 interact with the bounding box are returned.

If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.

Mapping File Syntax

<ReaderKeyword>_SEARCH_ENVELOPE <minX> <minY> <maxX> <maxY>

Note: If all four coordinates of the search envelope are specified as zero, the search envelope will be disabled.

Required/Optional

Optional

Workbench Parameter

Minimum X, Minimum Y, Maximum X, Maximum Y

SEARCH_ENVELOPE_COORDINATE_SYSTEM

This directive specifies the coordinate system of the search envelope if it is different than the coordinate system of the data.

The COORDINATE_SYSTEM directive, which specifies the coordinate system associated with the data to be read, must always be set if the SEARCH_ENVELOPE_COORDINATE_SYSTEM directive is set.

If this directive is set, the minimum and maximum points of the search envelope are reprojected from the SEARCH_ENVELOPE_COORDINATE_SYSTEM to the reader COORDINATE_SYSTEM prior to applying the envelope.

Required/Optional

Optional

Mapping File Syntax

<ReaderKeyword>_SEARCH_ENVELOPE_COORDINATE_SYSTEM <coordinate system>

Workbench Parameter

Search Envelope Coordinate System

CLIP_TO_ENVELOPE

This directive specifies whether or not FME should clip features to the envelope specified in the SEARCH_ENVELOPE directive.

Values

YES | NO (default)

Mapping File Syntax

<ReaderKeyword>_CLIP_TO_ENVELOPE [yes | no]

Workbench Parameter

Clip To Envelope

EXPOSED_ATTRS

This directive allows the selection of format attributes to be explicitly added to the reader feature type.

This is similar to exposing format attributes on a reader feature type once it has been generated; however, it is even more powerful because it enables schema-driven applications other than Workbench to access and leverage these attributes as if they were explicitly on the schema as user attributes.

The result of picking a list of attributes is a comma-separated list of attribute names and types that will be added to the schema features. Currently all reader feature types will receive the same set of additional schema attributes for a given instance of the reader.

Required/Optional

Optional

Mapping File Syntax

Not applicable.

While it is possible for FME Objects applications to invoke this directive, the required format is not documented.

This directive is intended for use in our GUI applications (for example, Workbench) only.

Workbench Parameter

Additional Attributes to Expose