OpenStreetMap (OSM) XML Reader Parameters
The OpenStreetMap (OSM) is a collaborative mapping project for creating a free and editable map of the whole world. Further information on OSM can be found at http://www.openstreetmap.org.
OpenStreetMap data can be downloaded in a topologically structured XML format. The data primitives in an OSM data file are nodes, ways and relations.
- A node is a lat/lon pair.
- A way is a list of at least two node references describing a linear features. Ways can be closed, in which case the first and the last node are identical. Areas are not explicitly represented in OSM but are identified via community approved tags.
- Relations are a group of zero or more primitives with an associated role.
All data in OSM are in the WGS-84 datum.
OSM has no explicit schema (feature type) definitions. Each node, way, and relation can have an arbitrary number of attributes, called tags in OSM. A tag is composed of a key and a value. The OpenStreetMap wiki does define a set of recommend tags that can be used to classify the nodes and ways into higher level groupings, i.e., feature types. The community-defined feature types can be found at http://wiki.openstreetmap.org/index.php/Map_Feature.
The FME OSM reader settings can help influence the classification of the OSM data being read.
Feature Types
You can choose either OSM Community-Approved Feature Types, or User-defined Feature Types. This selection determines which areas of the dialog below are enabled or disabled.
To determine the possible attribute name/value pairs of each feature type, the reader can either perform a schema scan on the entire data file, or it can provide an extensive list of feature types from which the desired types can be manually selected.
A schema scan on a large file can be a slow process: in these cases, it may be more desirable to simply select feature types manually.
Note: This parameter is used only when generating an initial workspace, so it is not editable within Workbench after the workspace has been generated.
OSM Community-Approved Feature Types
This option allows you to specify the predefined FME factory pipeline that categorizes the nodes, ways, and relations into the recommended interpretations found in http://wiki.openstreetmap.org/index.php/Map_Features. The options are:
The OSM reader will leave the OSM nodes, ways, and relations unprocessed.
The OSM reader will use the <FMEInstallDir>\xml\osm\schemaMap\osm_broad_schema.fmi to categorize the OSM data primitives into broader categories. The osm_broad_schema.fmi contains a sequence of FME factories that would assign a node, way, or relation an specific feature according to the existence of certain tag keys. For example, any way with a ‘highway’ tag key regardless of its tag value will be categorized into a highway feature type.
The OSM reader will use the <FMEInstallDir>\xml\osm\schemaMap\osm_specific_schema.fmi to categorize the OSM data primitives into more detailed categories. The osm_specific_schema.fmi pipeline contains a SchemaMappingFactory that loads a CSV file, <FMEInstallDir>\xml\osm\schemaMap\osm_specific_schema.fmi, to help it categorize the OSM data primitives according to the tag key and tag value. For example, any OSM way primitive with a ‘highway’ tag key and tag value of ‘primary’ will be categorized into a highway_primary feature type.
Geometry and Attribute Options
Specifies whether the OSM reader should create area geometries for OSM ways, whose first and last point equal, even if their “area” tag is not appropriately set. The default is Yes.
Controls whether way feature types should have the list of nodes added to the features as list attribute.
Controls whether multipolygon relation feature types (that is, type tag has a multipolygon value) should have its geometry built if checked, or kept as a list attribute containing all the members if left unchecked.
Controls whether way feature types should allow consecutive duplicate coordinates to be added to the line.
For example, if two unique nodes referenced by a line have the same location, the usual behavior is to remove duplicate points from the line. Since removing a duplicate point in this case would mean that the number of nodes and vertices would no longer match, checking this parameter allows the duplicate point to remain.
User-Defined Feature Types
This option is enabled when the Feature Type Definitions is set to User-defined Feature Types. It points to a user-defined factory pipeline (*.fmi file) that can be used to transform the OSM nodes, ways, and relations into user-defined feature types.
This parameter relies on a text file that lists the way feature types should be converted into area geometries when their first and last coordinates equal.
The format of the text file is simple: each feature type that should be considered a possible area is listed on a separate line. Two example files can be found under <FME InstallDir>\xml\osm\AreaFeatureLists\osm_specific_areas.txt and <FME InstallDir>\xml\osm\AreaFeatureLists\osm_broad_areas.txt.
Note: This parameter is used only when generating an initial workspace, so it is not editable within Workbench after the workspace has been generated.
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 where you have multiple feature types, it is convenient to expose additional attributes using this one parameter. For example, if you have ten feature types and want to expose the same attribute in each one, it is easier to define it once than it is to set each feature type individually in the workspace.
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.
If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.
Select this parameter to remove any portions of imported features being read that are outside the Search Envelope.
The illustration below shows the results of the Search Envelope when Clip to Search Envelope is set to No on the left side and Yes on the right side.
- 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 set to Yes, a clipping operation is also performed in addition to the intersection.