span8
span4
span8
span4
INSPIRE is a European Union directive that aims to create an infrastructure of EU spatial data to enable policy making across boundaries and improve public access to spatial information. Open standards such as the Open Geospatial Consortium Web Feature Service (OGC WFS) are used to facilitate the exchange of INSPIRE data. For more information, please visit theINSPIRE website.
Web services are a great way to share INSPIRE data and this is made possible with FME. In FME, OGC web services are hosted by publishing a ‘service broker’ workspace to FME Server registered under the Data Streaming Service.
Note: this requires FME Server 2014 or later to support the INSPIRE GML Writer.
FME workspace as web service broker for WFS
Safe Software has deployed this WFS demo live on FME Cloud. Users can view the service using the WFS Reader in FME Data Inspector or from any WFS client.
https://demos-safe-software.fmecloud.com/fmedatastreaming/INSPIRE/INSPIRE_WFS.fmw
When published locally, the service URL is:
http://localhost/fmedatastreaming/INSPIRE/INSPIRE_WFS.fmw
This tutorial contains a basic example of a WFS with 2 feature types, spatial extents queries and an XML filter operation, though these can be extended by following the approach laid out in this workspace.
Instead of a workspace that just handles data conversion, the ‘service broker’ workspace handles the web message traffic – accepting requests and generating responses according to the chosen service standard.
The INSPIRE_WFS workspace accepts GET (URL) or POST (XML) requests, commonly known as: GetCapabilities, DescribeFeatureType and GetFeature. Two writers are used depending on which request is being made. For the GetCapabilities and DescribeFeatureType XML document responses, the Text File (TEXTLINE) writer is used. For GetFeature responses, the INSPIRE GML writer is used.
In general, this workspace checks for character encoding. If URLs / requests are percent encoded (which is the case for those coming from Data Inspector) then they will be decoded to ASCII.
有三个步骤,以确定哪些请求类型is being made:
Note: the GetCapabilities document does not usually change so it could be a static file. The XMLTemplater process was included to demonstrate how a response message could be composed.
Upload all required resources
Ensure that the reader and writers are registered with the Data Streaming service
In FME Server if there is a GET request the input parameters captured by the user selections in the workspace published parameters are implemented in the request URL and the text file input is not used.
如果你发送一个POST请求它自动overrides the input of this workspace with the POST body (The POST body is the complete WFS request, for example the WFS GetFeature XML with any filter query embedded).
Published parameters accessible through Data Streaming on FME Server
Example URL for accessing the WFS
If you would like to add a Filter you can add an XML Filter Expression and/or a Search Envelope. You can find some examples of this below:
Use the following XML filter expression in the Reader Constraints:
inspireId.Identifier.localId 136000AZ0063
Response in WFS client:
Filter Cadastral Parcels by ID. Map tiles byStamen Design, underCC-BY-3.0. Data byOpenStreetMap, underCC-BY-SA.
Use the following XML filter expression:
GeographicalName_language Italian
Result in WFS Client:
Filter NamedPlace data by Language = Italian. Map tiles byStamen Design, underCC-BY-3.0. Data byOpenStreetMap, underCC-BY-SA.
Any web service, such as WCS, WPS, WMTS or SOS could also be supported by this FME service broker workspace approach. All that is required is to understand the web service protocol client / server requirements and configure accordingly. New service types would require some setup / configuration to implement the message handling compatible with that service standard, but this approach gives the user control to configure, customize, update and extend their web services how they want.
The data used here originates from data made available by theINSPIREand contains information and reads from a staging PostGIS database licensed under theCreative Commons Attribution (cc-by) 4.0
© 2019 Safe Software Inc |Legal