Esri Shapefile Writer Parameters
Writer Parameters
Specifies the encoding to be used when writing attribute names and attributes.
If the value is not set, the character encoding will be automatically detected from the first feature the writer receives. If the value is set, it will take precedence over the automatically detected character encoding.
The output Shapefile .dbf will contain the language driver ID for the selected or detected encoding, if no language driver ID is available for the encoding, a .cpg file may be generated instead.
FME supports most encodings.
When selected, this option creates a single zipped .shz file that contains all the files that comprise a shapefile dataset.
For example, coast.shz will contain coast.shp, coast.dbf, coast.shx (as well as any other supporting files, if applicable).
Each .shz file corresponds to one layer (feature type).
This format does not natively support storage of a datetime type – only a date formatted as YYYYMMDD. Historically, the writer would write datetime as a char(20) to preserve any time values that might have been present, but would lose the datetime schema type.
This option allows users to write datetime attribute values as dates only if required, keeping the schema type of date but dropping any time values that may be present.
- As String (FME Datetime Format) is the default option and previous behavior. Datetime schema types will be written as char(20) to allow all variants of the FME datetime format to be written.
- Date (YYYYMMDD only) will cause the writer to preserve only the date portion of datetime, but will keep the date schema type for reading in other applications. If time is dropped from any values, a warning will be written to the log.
Spatial
Coordinate systems may be extracted from input feature data sources, may come predefined with FME, or may be user-defined. FME allows different output and input coordinate systems, and performs the required coordinate conversions when necessary.
If a coordinate system is specified in both the source format and the workspace, the coordinate system in the workspace is used. The coordinate system specified in the source format is not used, and a warning is logged. If a source coordinate system is not specified in the workspace and the format or system does not store coordinate system information, then the coordinate system is not set for the features that are read.
If a destination coordinate system is set and the feature has been tagged with a coordinate system, then a coordinate system conversion is performed to put the feature into the destination system. This happens right before the feature enters into the writer.
If the destination coordinate system was not set, then the features are written out in their original coordinate system.
If a destination coordinate system is set, but the source coordinate system was not specified in the workspace or stored in the source format, then no conversion is performed. The features are simply tagged with the output system name before being written to the output dataset.
For systems that know their coordinate system, the Coordinate System field will display Read from Source and FME will read the coordinate system from the source dataset. For most other input sources, the field will display Unknown (which simply means that FME will use default values). In most cases, the default value is all you'll need to perform the translation.
You can always choose to override the defaults and choose a new coordinate system. Select More Coordinate Systems from the drop-down menu to open the Coordinate System Gallery.
Changing a Reprojection
To perform a reprojection, FME typically uses the CS-MAP reprojection engine, which includes definitions for thousands of coordinate systems, with a large variety of projections, datums, ellipsoids, and units. However, GIS applications have slightly different algorithms for reprojecting data between different coordinate systems. To ensure that the data FME writes matches exactly to your existing data, you can use the reprojection engine from a different application.
To change the reprojection engine, Select Workspace Parameters > Spatial > Reprojection Engine. In the example shown, you can select Esri (but the selection here depends on your installed applications):
- The coordinate systems file coordsys.db in the FME installation folder contains the names and descriptions of all predefined coordinate systems.
- Some users may wish to use coordinate systems that do not ship with FME, and in those cases, FME also supports custom coordinate systems.
- Learn more about Working with Coordinate Systems in FME.
Specifies whether or not to generate spatial index files when writing shapefiles.
- None – No spatial index is written.
- ArcGIS Compatible Spatial Index – An ArcGIS-compatible spatial index is written. ArcObjects is not required to be present on the system for this type of index to be created.
- QGIS and MapServer Spatial Index – A QGIS-compatible spatial index will be written.
- Both ArcGIS and QGIS/MapServer Compatible – Both index types will be written.
- Dimension from First Feature – Shapefiles produced will contain geometries with dimension information obtained by the first feature observed by the writer.
- 2D – Shapefiles produced will contain two-dimensional coordinate geometry.
- 2D + Measures – Shapefiles produced will contain two-dimensional coordinate geometry and measures.
- 3D + Measures – Shapefiles produced will contain three-dimensional coordinate geometry and measures.
- Multipatch – To preserve the original structure, the writer will write input 3D surfaces and solids as shape_multipatch.
- Polygon – To break 3D surfaces into polygon components, the writer will write input 3D surfaces and solids as 3D shape_polygon.
This parameter controls the handling of measures data associated with geometric data or attributes on the incoming features:
- No – Preserves the measures on the features. This is the default.
- Yes – Measures data is created from the z values on the incoming features, if the z values exist. If measures data exists, it is not overwritten by the z values on the feature.
Advanced
Shapefile component files have a 2-gigabyte size limit. This parameter allows the writer to bypass this limitation.
If FME detects a file size larger than 2 GB, it splits the dataset into separate, sequentially numbered output files. (Note, however, that when reading these files, FME treats them as separate datasets.)
By default, this parameter is checked.
Shapefiles have a maximum attribute limit of 255. Some programs may not be able to correctly read more than this number of attributes.
Setting this parameter to Yes will enforce the limit. Setting this parameter to No will ignore the limit and produce files that may not be readable by other programs.