2. FME – The Tool for OGC
Services
FME 2014!
The most powerful tool for
creating, transforming,
distributing and using complex
XML / GML over OGC services
No coding! No XSLT!
4. What is a Web Service?
HTML Request sent to web server via
HTTP GET, POST, PUT or DELETE
URL may have parameters (GET)
Body of request can be anything but is
commonly XML or JSON (POST)
Server takes request, grinds it, and sends
back response (often XML or JSON)
5. FME Approach to Web Services
Remove the mystery – no coding
required
Web service - just another format
Consume web services with Inspector
or workspace
Do value added transformations /
processing
Workspaces which accept / generate
XML* become web services once
published to FME Server**
6. XML and JSON Transformers
XMLFlattener
XMLValidator
XMLFormatter
XMLUpdater
XMLTemplater
JSONFlattener
JSONTemplater
Just type ‘XML’ or ‘JSON’
9. Using Web Services
ftp, http, ...
ODATA
OGC (WFS, WCS, WMS, ...)
SOS
ArcGIS Online
any service...
10. Your Data to/from Complex GML
FME can read or write over 325 formats
FME has supported xsd based GML reading for some time
New in FME 2014: GML writer application schema mode
Complete support for complex schemas – xsd’s
If you can read it – you can write it!
11. Consuming Complex GML data
FME takes the pain out of reading and
leveraging complex GML and web services
Benefit from the diverse array of freely
available published data sources
New Data Inspector makes it easy to
visualize all types of data: 2D or 3D, vector or
raster, non-spatial or complex geometries
See web services webinar, August 2013
12. FME 2014 GML Developments
Improvements to GML Reader to capture
full schema model
New GML writer – write
anything that GML reader can read
New generic web services
published workspace handles
message brokering and data
publish virtually any web service
and data stream (xml, json, …)
see OGC Web Services lizard talk
13. Key points on the FME GML Writer
GML writing in schema mode uses destination model
captured from the application schema (xsd)
map directly to destination feature type fields, like
other formats
multiple, complex geometry support
geometry names and traits
voidable attributes in output GML / FME null support
XMLTemplater no longer needed for GML writing, but still
useful for other XML generation like metadata
14. Web Service Request Response
Web Server
url request via get, post, put, delete
Response JSON, XML
All web services follow the same pattern
15. Build any web service!
Any service is now a workspace away.
FME Data Streaming service delivers
response.
Power of FME is Transformation
CodeNo
Code!!
16. FME Workspace as
Web Service Broker for WFS
FME WFS
Workspace
GetCapabilities Request
Response XML
FME Server
17. FME Workspace as
Web Service Broker for WFS
FME WFS
Workspace
describeFeatureType Request
Response XML
FME Server
18. FME Workspace as
Web Service Broker for WFS
FME WFS
Workspace
getFeature Request
Response XML
FME Server
19. FME Workspace as
Web Service Broker for WFS
FME WFS
Workspace
GetCapabilities Request
Response XML
GetFeature Request
Response GML
FME Server
20. WFS Workspace Workflow
1. Extract parameters from request (GET / POST)
2. Determine request type
3. For GetCapabilities, DescribeFeatureType:
return appropriate response xml
4. For GetFeature:
i. Determine request feature type
ii. Parse bbox and filter xml to geometry and fields
iii. Apply bbox and where filter to FeatureReader
iv. Apply schema transformation and output GML
31. Troubleshooting
Copy http request from inspector log to browser
to test server responses
Download GML with browser to test if problem is
with WFS client / server or GML reading
Try removing all constraints except for max
features
Try specifying local schema file (.xsd)
32. Summary
FME makes it easy to use, leverage and produce web services
New GML writer, validation and web service support make
publishing complex GML to services a breeze (INSPIRE etc)
FME Server workspace service broker approach provides a
completely new way to build web services – no code!
Can be used to build all types of web services from WFS,
WMS, WMTS, Odata, Junaio AR, SOS, etc.
FME, a “No-code” approach to web services
33. Thank You
More info: info@safe.com
Safe’s Demo WFS Server:
http://inspire-safe-
software.fmecloud.com:80/fmedatastreaming/INSPIRE/INSPIRE_WF
S.fmw
FMEpedia:
http://fmepedia.safe.com/articles/How_To/GML-Writing
Notes de l'éditeur
FME 2014 has filled all the gaps and is now the best tool for creating INSPIRE compliant data
For a typical GET, the input is just a URL and the output is an XML data stream. The client doesn’t know or care how the service is hosted.
**using the data streaming service.*Or JSON. Published XML/JSON must conform to relevant web service standards or conventionsMention that FME Server can redirect input as well as output. Also as of 2014 server can provide complete calling URL as an input parameter for workspace to parse.Also, possible to create workspaces which both consume and publish web service data streams – interaction
Just type XML / JSON on the workbench canvas
See Web Services and XML transformers sections in Transformer Reference Guidehttp://cdn.safe.com/resources/fme/FME-Transformer-Reference-Guide.pdf
No time to demo all these, simply state the FME can read and add value to all of these. Often new web services are built on existing ones, so important to read as well as publish.
No one comes close to FME’s breadth of format support and INSPIRE GML is no exception.Not just geometry support
Sept web services webinar: http://safe.com/webinars/web-services-made-easy-without-any-coding/
Mention that FME Server can redirect input as well as output. Also as of 2014 server can provide complete calling URL as an input parameter for workspace to parse.Generic web service support:Configurable serverEasily change schemaPublish complex XML, JSON, or anything!!Leverage GML writer’s powerful new schema mode in FME 2014
GML writing in schema mode uses application schema (.xsd’s) - destination model captured from the application schemamap schema directly to destination feature type fields - like other formatsmultiple, complex geometry supportgeometry names and traitsvoidable attributes in output GML / null support in FMEXMLTemplater no longer needed for GML writing, but still useful for other XML generation like metadataNo longer a template based approachUse FME’s INSPIRE reader to confirm your output is ok
Mention that FME Server can redirect input as well as output. Also as of 2014 server can provide complete calling URL as an input parameter for workspace to parse.Generic web service support:Configurable serverEasily change schemaPublish complex XML, JSON, or anything!!Leverage GML writer’s powerful new schema mode in FME 2014
This next set of 4 slides is essentially a step-wise animation showing the messages that go to / from the WFS workspace. Just explain what the input and output is for each step.
These slides are of interest for those who want to set up the WFS demo on their own FMEServer
These slides are of interest for those who want to set up the WFS demo on their own FMEServer
WFS Demo Script - FME 2014 World TourDemo Options: Either play the movie or follow this script in the Data Inspector and do the steps manually yourself. The movie is 4 minutes. Manual demo will take longer.To play movie, open INSPIRE_WFS_demo.wmv Note, the audio has some noise, so best to play with volume off, and you will need to explain what is shown.Demo Steps (as shown in movie):PART A: Cadastral Parcels:0. Set up Data Inspector ahead of time. Under FME Options set background maps to Stamen and select 'toner' to provide a suitable backdrop. Set your My Default parameters for WFS to be the same as those shown in the movie or screen shots in the ppt. Test to make sure you are getting a timely response. If you do not have internet access then stick with the movie and local workspace below.1. Add a dataset with the WFS reader on the INSPIRE_WFS.fmw at: http://inspire-safe-software.fmecloud.com:80/fmedatastreaming/INSPIRE/INSPIRE_WFS.fmw2. Click on the WFS settings, click to Feature Types (...)and choose Cadastral Parcels. Note that this fires a 'getCapabilities' request to INSPIRE_WFS.fmw WFS server. Also, note that this server only allows the selection of one feature type at a time. If you see nothing here then you have a problem with the url or your internet connection. Safe's INSPIRE demo requires no login.3. Make sure the XML filter and spatial query fields are empty, and press OK. After about 10-15 seconds the parcels data from Perpignan in southwest France should appear. If your data appears off of Africa, then you set the SRS axis order incorrectly - should be blank. If nothing happens after more than a minute - hit stop and check all your settings, spatial envelope and try again. If your settings yield no data the client can sit and wait a long time before timeout.4. Find a large parcel and click on it to find the ID. The one selected in the movie is CadastralReference = 136000AZ00635. Copy this ID, add a new WFS view with the same settings as before. Then go into the XML Filters field under settings and paste the ID into an xml filter of the form:<Filter><PropertyIsEqualTo><PropertyName>inspireId.Identifier.localId</PropertyName><Literal>136000AZ0063</Literal></PropertyIsEqualTo></Filter>Note that spelling must be exact. This will be parsed by the WFS workspace into _whereQuery =`inspireId.Identifier.localId='136000AZ0063'Click OK. The result will be a view with only that parcel returned.PART B: Named Places (Optional - only if time) 1. If time permits do the same for NamedPlaces - Add a dataset with the WFS Click on the WFS settings, click to Feature Types (...) and choose Named Places only (uncheck Cadastral Parcels).2. This time we set a spatial query from for Named Places SPATIAL QUERY: Xmin=0, Ymin=35, Xmax=5, Ymax = 47. Make sure the XML filter is empty. Press OK. You should now see named place data for W France (overlaps parcel data).3. Finally, we select all the named places for Italy. Add a new WFS dataset for Named Place, and set up this XML filter:<Filter><PropertyIsEqualTo><PropertyName>GeographicalName_language</PropertyName><Literal>Italian</Literal></PropertyIsEqualTo></Filter>Note: If you forget to uncheck or change the spatial filter, you get an XMLparser error since there is no data returned. To correct this change the spatial filter to: Xmin=0, Ymin=35, Xmax=20, Ymax = 47, or just uncheck it.PART C: INSPIRE_WFS.fmw1. Open the workspace: INSPIRE_WFS.fmw2. Explain the data flow for each primary WFS request type: GetCapabilities, DescribeFeatureType, and GetFeature. Ignore POST and focus on GET as this is easier to explain.3. 'Run with prompt' and show the behaviour of the workspace with different request types to show how the output is an XML document for GetCapabilities, an XSD for DescribeFeatureType and GML for GetFeature. 4. Examine the output files in an XML/Text editor for each of the above request types. XML output goes to outText.xml, GML output goes to outGML.xml.5. Open the output GML in Data Inspector using the INSPIRE reader.PART D: FMEServerIf you really want to go in depth, see the setup_readMe.txt and install this on your own FMEServer. Contact Dean or Ken if you need help with this.
Emphasize how the URL parameters get mapped to the workspace parameters of the same name. for example &TYPENAME=NamedPlace tells the server to return the NamedPlace theme.Also, remind them that this approach involves publishing to the datastreaming service (NOT the WFS service)http://inspire-safe-software.fmecloud.com:80/fmedatastreaming/INSPIRE/INSPIRE_WFS.fmw?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=NamedPlace&MAXFEATURES=1111
Main or parent workspace. This workspace handles all the web service messaging. GML generation is handled by child – custom transformersEmphasize high level data flow:Extract parameters from request (GET / POST) (ParameterFetcher)Determine request type (TestFilter)For GetCapabilities, DescribeFeatureType: return appropriate response xml (see bookmarks)For GetFeature:Determine request feature type (AttributeFilter)Parse bbox and filter xml to geometry and fields (custom transformers …)Apply bbox and where filter to FeatureReaderApply schema transformation and output GML
Cadastral parcels feature extraction, filtering and geometry transformation to INSPIRE schema
Geographical Names feature extraction, filtering and geometry / attribute transformation to INSPIRE schema
Parse filter xml to attribute name and value fields to support building WHERE clause
Usebbox parametersto build geometry for use in spatial query
WFS reader settings showing source dataset URL, theme selection, typical WFS reader parameters and example XML filter expression for parcel ID query
Example Geographical Names WFS query and result using both xml filter and search envelope parameters as follows:Filter query: <Filter><PropertyIsEqualTo><PropertyName>GeographicalName_language</PropertyName><Literal>Italian</Literal></PropertyIsEqualTo></Filter>Extents query: Xmin = 5, Ymin = 38, Xmax = 15,Ymax = 45
Cadastral Parcels result without any filter
Cadastral Parcel WFS result using xml filter = <Filter><PropertyIsEqualTo><PropertyName>inspireId.Identifier.localId</PropertyName><Literal>136000AZ0492</Literal></PropertyIsEqualTo></Filter>
Only for those who want to extend the WFS workspace template
Fmeserver upload / qaRemove the mystery – no coding requiredWeb service - just another formatConsume web services with Inspector or workspaceDo value added transformations / processingWorkspaces which accept / generate XML become web services once published to FME Server*Create workspaces which both consume and publish web service data streams – interaction
More to come on FMEpedia and at FMEUC in Vancouver