Writer Directives
The directives processed by the GMLSF Writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword> in a mapping file. By default, the <WriterKeyword> for the GMLSF writer is GMLSF.
DATASET
Required/Optional: Required
This directive specifies the location for the output GML instance document.
Example:
GMLSF_DATASET c:\gml\data.xml
Workbench Parameter: Destination GML Simple Features Level SF-0 Profile File
WRITE_ALL_FEATURE_TYPE_DEFNS
Required/Optional: Optional
By default, every GML writer DEF line is translated to the output GML application schema document as an XML Schema element declaration and a corresponding complex type definition. Setting this directive to NO directs the writer to ignore those DEF lines that have no corresponding feature instances. The valid values for this directive are YES and NO. The default is YES.
Example:
GMLSF_WRITE_ALL_FEATURE_TYPE_DEFNS NO
Workbench Parameter: Write all feature type definitions
TARGET_NS_PREFIX
Required/Optional: Optional
The directive specifies the GML application schema target namespace prefix. The default value for this directive is fme.
Example:
GMLSF_TARGET_NS_PREFIX ns
Workbench Parameter: Target namespace prefix
TARGET_NS_URI
Required/Optional: Optional
The directive specifies the GML application schema target namespace URI. The default value for this directive is
http://www.safe.com/gml/fme.
Example:
GMLSF_TARGET_NS_URI http://www.contrivedurl.com/gmlsf
Workbench Parameter: Target namespace URI
XSD_DOC
Required/Optional: Optional
The file location for the output GML application document. If left blank, then the .xsd file will be created in the same folder and with the same file basename as the output dataset.
Workbench Parameter: GML schema document
OUTPUT_ENCODING
Required/Optional: Optional
The directive specifies the encoding to use for the output XML documents, which include both the GML instance and the GML application schema. The default value for this directive is UTF-8
.
Example:
GML_OUTPUT_ENCODING ISO-8891-1
Workbench Parameter: Output encoding
SYSTEM_ENCODING
Required/Optional: Optional
This directive specifies the encoding for the incoming schema and data feature. If unspecified, then the writer assumes that the schema and data features are encoded with the system’s encoding.
Example:
For example, if features fed into the GMLSF writer are encoded in UTF-8, then the following should be set:
GMLSF_SYSTEM_ENCODING UTF-8
Workbench Parameter: System encoding
SUPPRESS_XSD_DOCUMENT
Required/Optional: Optional
This directive suppresses the output of the GML application schema when it is set to YES. The default value for this directive is NO.
Example:
GMLSF_SUPPRESS_XSD_DOCUMENT YES
Workbench Parameter: Suppress GML schema document
FEATURE_COLLECTION
Required/Optional: Optional
The valid values for this optional directive are target-namespace and wfs. Setting this directive to wfs changes the root element in the output document to <wfs:FeatureCollection>. In addition, appropriate XML namespace declarations and xsi:schemaLocation entries are added to include the WFS schemas. The default value for this directive is target-namespace.
Example:
GML_FEATURE_COLLECTION wfs
Workbench Parameter: Feature Collection
TARGET_XSI_SCHEMALOCATION_URL
Required/Optional: Optional
By default, the URL for the target namespace URI - URL location pair in the instance document’s xsi:schemaLocation attribute is the GML application schema’s relative filename. This directive allows the user to overwrite the .xsd filename by supplying a custom URL. The directive only affects the value of the URL for the target namespace in the xsi:schemaLocation. It does not affect where the application schema will be written (for this, see the XSD_DOC directive). The directive should have exactly one URL value indicating the XSD location for the target namespace URI.
If the directive has multiple values, then they must be whitespace-separated URI–URL pairs. This option allows the user to provide a complete custom xsi:schemaLocation for the output document.
Example:
GMLSF_TARGET_XSI_SCHEMALOCATION_URL http://www.conurl/ns.xsd
COMPLIANCE_LEVEL_SCHEMA_LOCATION
Required/Optional: Optional
This directive allows the user to set the URL location of the GMLSF compliance levels schema. This URL is transferred to schemaLocation attribute in the <import> element for the “http://www.opengis.net/gmlsf” namespace in the generated GMLSF .xsd document. The default value for this directive is “http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsfLevels.xsd”.
Example:
GMLSF_COMPLIANCE_LEVEL_SCHEMA_LOCATION http://www.example.com/gmlsf/1.0
Workbench Parameter: GMLSF compliance levels schema location
VERSION
Required/Optional: Optional
This directive allows the user to set the version of the GML schema document. The default value is “1.0.0”.
Example:
GMLSF_VERSION 4.1
Workbench Parameter: GMLSF application schema version
SRS_NAME
Required/Optional: Optional
This directive allows the user to overwrite the CRS value that is written in the GML instance’s srsName attributes. By default, the FME coordinate system name in a feature is transferred directly onto the srsName attribute. This directive allows users to provide their own URN CRS string for the srsName attributes.
Example:
GMLSF_SRS_NAME urn:ogc:def:crs:EPSG:6.6:4326
Workbench Parameter: GML srsName
SRS_AXIS_ORDER
Required/Optional: Optional (Required if using SRS_NAME)
This directive is required when the SRS_NAME directive is used. It specifies the axis order for a coordinate tuple in a GML <pos> or <posList> element. The valid values for this directive are “1,2”, “2,1”, “1,2,3” and “2,1,3”. There is no default value for this directive.
For example, if SRS_NAME is set to “urn:ogc:def:crs:EPSG:6.6.4326”, then the SRS_AXIS_ORDER should be set to “2,1” so that the coordinates in the GML <pos> and <posList> elements are written in lat-lon order:
GMLSF_SRS_AXIS_ORDER 2,1
Workbench Parameter: GML SRS Axis Order
SUPPRESS_XSI_SCHEMALOCATION
Required/Optional: Optional
Setting this directive to YES suppresses the output of the xsi:schemaLocation
attribute in the GML instance’s root element. The xsi:schemaLocation
in an XML document instance is not a mandatory attribute – it is merely a hint which an XML processor may choose to ignore. Setting this directive to YES suppresses the output of the xsi:schemaLocation attribute in the output GML instance. The default value for this directive is NO.
Mapping File Syntax
GMLSF_SUPPRESS_XSI_SCHEMALOCATION YES
Workbench Parameter: Suppress xsi:schemaLocation attribute
Workbench Parameter: Target xsi:schemaLocation URL