OData Reader Parameters
The Open Data Protocol (OData) is a web protocol for querying and updating data that builds upon web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to remote information.
The OData specification defines the request and response rules for the retrieval of both spatial and non-spatial geographic information using either ATOM or JSON. This reader retrieves data through JSON. While some feeds may be stored as ATOM, it is possible for them to also be read as JSON given that they are using API version 2.0 or later.
Connection Parameters
The dataset can be one of the following: an OData service, represented by a service root URI, or an OData feed, represented by a service root URI plus a specific resource path. This field may or may not contain a trailing solidus ('/'). The dataset must point to one of the following: a valid OData service document, which is able to return the list of feeds available for consumption, or a valid OData feed. If a specific feed is supplied in the dataset field (in other words, a resource path is supplied), then only this feed will be read. All other feeds specified in the feed list parameter box will not be read.
A URI used by an OData service has up to three significant parts: the service root URI, resource path and query string options. Query strings are no longer supported on each individual feed.
For example:
A typical URI specifying an OData service looks like:
ODATA_DATASET http://services.odata.org/OData/OData.svc/
If the OData service requires Basic or NTLM authentication, specify it here.
These fields are enabled when authentication is in use.
Constraints
OData version 3.0 and later provide support for spatial data in two types: geography and geometry. Both types can include points, lines, polygons, and collections. The only difference is that the geography type uses the EPSG:4326 coordinate system, whereas geometry types do not have a coordinate system. Because of this, the reader parameter, “Source Geometry Type” is provided for the user to choose which type will be used as the feature geometry. The spatial type that is not selected as the Source Geometry Type will be treated as an attribute on the schema, where its GeoJSON data will be taken as the attribute values.
Source Geometry Type | Result: |
---|---|
Geometry | All OData properties within a feed that are geometry types will be aggregated onto the feature geometry. All geography types will be treated as attributes. |
Geography | All OData properties within a feed that are geography types will be aggregated onto the feature geometry. All geometry types will be treated as attributes. |
None | All OData properties within a feed that are either geometry or geography types will be treated as attributes. There will be no feature geometry. |
Advanced
This optional parameter specifies how many features to request from the OData service in a single request. The OData Reader will issue paginated requests until all features are read.
If this parameter is not provided, then the OData Reader will read as many features as the server returns in a single request, and automatically obey any server-side pagination.
Note: This parameter was introduced in FME 2016.1.1. Older workspaces continue to rely on server-side pagination.
Default: 1000
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.