Reader Directives

The suffixes listed are prefixed by the current <ReaderKeyword> in a mapping file. By default, the <ReaderKeyword> for the GML2 reader is GML2.

DATASET

Required/Optional: Required

This directive specifies the location for the input GML instance document.

Example:

GMLSF_DATASET c:\gml_data\hydro.xml

CACHE_XSD

Required/Optional: Optional

This directive allows the XML Schema documents that are fetched from the internet to be cached locally, this reduces the number of network fetches when traversing the GML schema documents. The valid values of this directive are YES and NO, its default value is YES.

Example:

GML2_CACHE_XSD NO

CACHE_XSD_EXPIRY_TIME

Required/Optional: Optional

This directive is optional and takes effect only if the CACHE_XSD directive is set to YES. The valid values for this directive are positive numbers denoting the number of seconds. The default value for this directive is 300.

Example:

GML2_CACHE_XSD_EXPIRY_TIME 600

CACHE_XSD_DIRECTORY

Required/Optional: Optional

This optional directive takes effect when CACHE_XSD directive is set to YES. The directive specifies the folder path for the location of the cache xsd folder, the folder name for the cache xsd folder is specified by the CACHE_XSD_NAME directive below. The default value for this directive is the user’s temporary folder.

Example:

GML2_CACHE_XSD_DIRECTORY c:\tmp

CACHE_XSD_NAME

Required/Optional: Optional

This optional directive specifies the xsd cache name. The cache name must also be a valid folder name, as this value is used as the subfolder containing the cached schema documents within the CACHE_XSD_DIRECTORY. The default value for this directive is FME_XSD_CACHE.

Example:

GML2_CACHE_XSD_NAME gml_schema_cache

DOCUMENT_STREAM

Required/Optional: Optional

The entire GML document can be specified as the string value of this directive. This directive is optional and it overrides the DATASET directive if present.

FEATURE_ENCODING

Required/Optional: Optional

This directive specifies the encoding for the FME features. The default value for the directive is the system’s encoding.

Example:

GML2_FEATURE_ENCODING Shift-JIS

HTTP_PROXY

Required/Optional: Optional

This directive specifies the HTTP proxy to be used for network fetches. The port number may be specified at the end of the proxy by appending :[port number] or through the HTTP_PROXY_PORT directive.

Example:

GML2_HTTP_PROXY www.someproxy.net

or

GML2_HTTP_PROXY www.someproxy.net:8081

Note: Users may bypass the HTTP_PROXY and HTTP_PROXY directives and still have http proxy support by specifying the http_proxy environment variable. The value for this environment variable should be of the form [protocol://][user:password@]machine[:port], where components within [ ] are optional. An example value for the http_proxy environment variable is: http://www.someproxy.net:8081.

HTTP_PROXY_PORT

Required/Optional: Optional

This directive is used if the HTTP proxy port was not specified in the HTTP_PROXY directive.

Example:

GML2_HTTP_PROXY_PORT 8081

MAPPING_FILE_ENCODING

Required/Optional: Optional

This optional directive specifies the encoding for the FME mapping file. The default value for the directive is the system’s encoding.

Example:

GML2_MAPPING_FILE_ENCODING ISO-8859-3  

READ_DEFAULT_GML_PROPERTIES

Required/Optional: Optional

This directive specifies whether the default and optional GML feature properties, fid, name, and description, should be read. The valid values of this directive are YES and NO; its default value is NO.

XFMAP

Required/Optional: Optional

This directive is not for general usage.

Rather than having the GML2 reader examine the GML application schema, it directs it to read the input dataset document with the specified xfMap. Alternatively, multiple xfMaps may be specified in a single value quoted XFMAP directive by separating each xfMap path with a semicolon. See the XML Reader/Writer chapter for a description of the xfMap.

Example:

GML2_XFMAP C:\tmp\data\features.xmp

or

GML2_XFMAP “C:\tmp\drainages.xmp;C:\tmp\pits_pipes.xmp”

or

GML2_XFMAP C:\tmp\drainages.xmp
GML2_XFMAP C:\tmp\pits_pipes.xmp

XFMAP_STREAM

Required/Optional: Optional

This directive is not for general usage.

Rather than having the GML2 reader examine the GML application schema, it directs it to read the input dataset document with the xfMap specified as the string value of this directive. See the XML Reader/Writer chapter for a description of the xfMap.

XFMAP_SCHEMA

Required/Optional: Optional

This directive is not for general usage.

Rather than having the GML2 reader examine the GML application schema, it directs it to read schema features from the input dataset document with the specified xfMap. Alternatively, multiple xfMaps may be specified in a single value quoted XFMAP directive by separating each xfMap path with a semicolon. See the XML Reader/Writer chapter for a description of the xfMap.

Example:

GML2_XFMAP C:\tmp\data\schema_features.xmp

or

GML2_XFMAP “C:\s_drainages.xmp;C:s_pits_pipes.xmp”

or

GML2_XFMAP C:\tmp\schema_drainages.xmp
GML2_XFMAP C:\tmp\schema_pits_pipes.xmp

XSD_DOC

Required/Optional: Optional

A GML instance document specifies the namespace and the location of its application schema through its root element xsi:schemaLocation attribute. This directive allows the GML2 reader to use a different GML schema document from the one specified in the xsi:schemaLocation attribute.

The XML Schema specification states that the xsi:schemaLocation attribute value consists of a set of pairs: The first member each pair is the namespace for which the second member is the hint describing where to find an appropriate schema document. The presence of this hint does not require the processor to obtain or use the cited schema document, however, the processor is free to use other schemas obtained by other suitable means.

The XSD_DOC directive allows the usage of other schema documents on the instance besides the one stated in the instance’s xsi:schemaLocation attribute.

Note: This directive only takes effect if the target namespace of the dataset is not in the Safe schema namespace http://www.safe.com/xml/schemas/FMEFeatures. The GML2 writer in FIXED SCHEMA_MODE writes out documents that belong to that namespace.

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