Esri Shapefile Reader Parameters
When reading shapefile features, the fme_type attribute will correspond to the geometry type specified in the shapefile's feature type parameters. For more information on this attribute, see Esri Shapefile Feature Representation
Reader Parameters
Character Encoding
This parameter controls which character encoding is used to interpret text attributes from the shapefile. This parameter is useful when the character encoding information stored in the shapefile is missing or incorrect.
By default, the character encoding will be automatically detected from the source shapefile (fme-source-encoding).
If you select any other character encoding, it will take precedence over the automatically detected character encoding.
Numeric Attribute Type Handling
Shapefiles store attributes in a text-based manner, so numeric attributes are converted to text before being written to disk. This parameter controls how FME reads these numeric types and influences how they will be written out at the end of a transformation.
This parameter defaults to Standard Types, which will cause the reader to convert the text representation of numeric attributes to a binary one, choosing a size that will safely contain all possible values of the fixed-width field. This can be useful when converting from shapefiles to a format that supports binary storage of numbers.
Selecting this option will cause FME to produce short and long types for numeric attributes with no decimal places, and float or double types for numeric attributes with decimals.
The other option available is Explicit Width and Precision, which will keep the attributes as fixed-length text-based fields. This option is preferred when performing a shapefile-to-shapefile translation, as the field widths will remain the same on write.
Selecting this option will cause FME to produce the same number(width, precision) types as the underlying dBASE file contains, which will ensure that writing to other fixed-width format types will not cause attribute sizes to increase during a translation.
If you are unsure which option to use, Standard Types will work in cases where fixed-length numbers is not a concern.
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, this parameter allows you to expose additional attributes on multiple feature types. Click the browse button to view the available format attributes (which are different for each format) for the reader.
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. (Note that this is the bounding box intersection only, and not a full geometry intersection that would be returned by a transformer like the SpatialFilter.)
If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.
Clip to Search Envelope
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.
When using a Search Envelope with Shapefile, the .shp being read must have an accompanying .sbn.
Advanced
This parameter specifies whether the reader should trim preceding spaces of attribute values:
- Yes – Preceding spaces in attribute values will be discarded. This is the default.
- No – Preceding spaces will be left intact.
Some programs write Shapefiles with non-standard padding characters in the .dbf.
If FME is reading 0 for values instead of a null or missing value, setting this option to Blank may correct this. In order to produce results similar to what ArcGIS reads, the default value for this option is Zero.
Unless you are experiencing null or missing numeric values being read as zero, this option will have no effect.
Whether these values are read as null or missing is controlled by the following option.
Shapefile makes no distinction between null or missing attribute values. This option determines how FME will read features for which the attribute has no value in the .dbf.
- Missing – Empty values will be read back as missing attributes on the output feature.
- Null – Empty values will be read back as null attributes on the output feature.
When creating donut geometries, this parameter specifies the criteria that FME will use to detect the geometric properties of the donut(s).
- Orientation Only – FME will detect donut geometry only based on orientation of the rings. Shapefile specifications state that outer boundaries of donut geometries must have clockwise orientation, and any donut holes must have counter-clockwise orientation.
- Orientation and Spatial Relationship – FME will detect donut geometry initially by orientation, and will perform additional geometric validation by analyzing the spatial relationships between the donut’s outer rings and holes. If any invalid donut geometries are identified, FME will attempt to correct geometric anomalies (for example, holes larger than outer ring, holes within holes, etc.)
If your dataset is supposed to have holes but FME does not correctly produce them, select Orientation and Spatial Relationship.
Note: There can be a significant difference in performance when reading very large datasets.
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.
This parameter controls whether the reader reports geometric anomalies in input shapefiles.
To ensure the validity of input features, the reader will close unclosed polygons and replace empty elements with null geometry.
If it is set to Yes, then the shape_geometry_error attribute will be set on input features, and will contain error codes as geometric anomalies are detected and/or fixed. If multiple codes exist on a feature, they will be comma-separated. The error codes are listed below:
Error Code |
Description |
---|---|
INVALID_POLYGON_CLOSED |
This polygon did not specify an end vertex that corresponded to the first vertex. The geometry has been fixed to ensure validity by adding an additional point that closes the polygon. |
INVALID_GEOMETRY_EMPTY |
This geometry had 0 parts/points and was collapsed into a Null shape instead. (for example, a Multipoint with 0 points contained). The geometry has been changed. |
INVALID_POLYGON_ORIENTATION |
This polygon does not follow the Shapefile specification of vertex ordering. Geometry is not changed, but donuts may not have been formed correctly. This anomaly is only produced when the reader parameter Donut Geometry Detection is set to Orientation Only. |