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
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.
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.
A search envelope (also known as a bounding box) is a rectangular area that defines a geographic area. In FME, the easiest way to define a search envelope is to use search envelope parameters.
Defining a search envelope is the most efficient method of selecting an area of interest because FME will read only the data that is necessary – it does not have to read an entire dataset. Search Envelope parameters apply to both vector and raster datasets and can be particularly efficient if the source format has a spatial index.
Most FME readers have parameters to define the search envelope of data that is being read:
The parameters include the x and y coordinates of the bounding box as well as a parameter that defines the coordinate system.
How to Define the Bounding Box
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 the bounding box intersection is not a full geometry intersection (based on spatial relationships) that would be returned by a transformer like the SpatialFilter.
Note: If all four coordinates of the search envelope are left at 0, the search envelope will be disabled even if this option is checked.
Search Envelope Coordinate System
Specifies the coordinate system of the search envelope if it is different than the coordinate system of the data. The coordinate system associated with the data to be read must always be set if this parameter is set.
If this parameter is set, the minimum and maximum points of the search envelope are reprojected from the Search Envelope Coordinate System to the reader’s coordinate system prior to applying the envelope.
The underlying function for Use Search Envelope is an intersection; however, when Clip to Search Envelope is checked, a clipping operation is also performed.
- When checked (set to Yes), this option instructs FME to clip features to the exact envelope boundary. FME removes any portions of imported features being read that are outside the search envelope.
- When left unchecked (set to No), features that overlap the boundary will be included in their full (unclipped) form.
Clip to Search Envelope: No |
Clip to Search Envelope: Yes |
---|---|
Any features that cross the search envelope boundary will be read, including the portion that lies outside of the boundary.
|
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 search envelope includes the bounding box and the extent of the raster.
|
The search envelope includes only the area within the bounding box. The raster size will still match the bounding box, but the area without data will be filled with Nodata values to represent the absence of data, if the source raster has them. Raster Nodata may be a single value across all bands, a single value per band, or a separate alpha or transparency band that indicates the lack of data values (this is more common in images than other types of rasters).
|
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. This option shall preserve the order of the areas.
- 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. |
Shapefile uses strings to store floating point numbers. This takes more storage space, but avoids some precision loss from binary encoding. For efficiency, FME reads float and double type attributes into binary fields which are faster to manipulate, but may result in precision loss when values have a high number of significant figures versus the width of the field in the .dbf. This option controls whether this conversion will take place during the read operation.
-
Yes – The reader will produce string-backed values for all float and double attributes, allowing exact representations of values in the .dbf file. Note: These values may be converted to binary representation anyway if any transformers operate on them, or when writing to other formats that support binary representations for float and double types. Enabling this option may have an impact on performance.
-
No (default) – The reader will produce native binary-backed values for all float and double attributes.