span8
span4
span8
span4
The OGC Web Mapping Service (WMS) was designed as a means of providing georeferenced,configurable images of your data over the internet.Examples of these use include setting an image as a background map in a web application or even an image overlay in services such as Google Earth.
OGC services define open standards that allow for data integration across a wide range of proprietary and open source applications.
FME Server provides a means of supporting these services by enabling users to register workspaces to a designated service to handle the receiving and transmission of web service messages to the client.This guide makes use of the Data Streaming service in FME Server and upon completion of these instructions you will have a functional WMS Service running from your FME Server,and how to implement this service from your own data.
There are two steps to set up the WMS Service:
The attached download package is ready to publish to FME Server and is set up to read and render the included sample SpatiaLite database.You may wish to publish the sample and test it in your desired WMS viewer before modifying the workspaces to serve your own data.
Step 1 - Load your Data
Locate FeatureReader using Navigator
Change source Data in Feature Reader
Step 2 - Modify the Private Parameters
Change Private Parameters in Navigator
Step 3 - Publish workspace to FME Server Data Streaming Service
Edit Data Streaming Properties before publishing workspace to FME Server
Step 4 (optional) - Configure Authentication
Change security permissions to allow open access to WMS service
Note: This workspace contains Python.FME 2019 will mark the beginning of the phase out process for compatibility with Python 2.7.For more information please readPython 2.7 deprecation.
Step 5 - Load your Data
Change source data in GetPNG.fmw
Step 6 - Modify the Styling and Rendering
Configure the MapnikRasterizer properties
Step 7 - Publish workspace to FME Server Data Streaming Service
It is much faster to test your workspace modifications locally before publishing up to FME Server.However,both workspaces use the URL that called them to determine image size and the layers and bounds to render on the returned image.Therefore,in order to run these workspaces successfully in FME Workbench,we will first need to supply a sample URL.
To find the sample URL to use publish the initial workspaces to the Samples repository.In the FME Server Web Interface find the GetCapabilities.fmw workspace and click on it.This will take you to the Run Workspace page,expose the Advanced section and find the Direct URL Example - click on this now to see the XML output you see from running the workspace.This URL will be used in FME Workbench to find the GetPNG sample URL so copy this link.
Direct URL location in FME Server
The GetPNG URL is more complex,since it contains the layers and bounds of the request.To get this,open a new workspace in FME Workbench,and add a WMS reader.For the dataset,use the GetCapabilities URL example we just copied.
Now click on Parameters… and then set up the Layers List,Map Width and Map Height.Enable Search Envelope,then provide lat/long coordinates for the Min X,Y and Max X,Y.A good starting point for the sample dataset is [-123.17,49.21,-123.11,49.26].Click OK to add the reader to the workspace.
Note: If you saved your workspace to a repository other than Samples and did not change the fmeguest settings covered in step 4 then you will need to select the ‘Use Network Authentication' box and add in the FME Server web connection or use basic login details.
WMS Reader parameters
Run the workspace and examine the log window for a line starting with
Find GET request sample URL for GetPNG.fmw workspace
Enter the URLs for the respective workspaces under the Navigator window in User Parameters > FME Server Parameters > FME Server Request URI parameter.The workspaces will now run correctly in FME Workbench.
Set FME_SERVER_REQUEST_URI in the Navigator
There are a number of ways to ensure that your WMS Service is functioning correctly.Listed below are two approaches: a simple web browser based method and FME's WMS client.However,as WMS is a standard you can use multiple tools.For example,software packages such as ArcGIS,Google Earth,and QGIS all have methods to connect to a WMS Service.
You can test your WMS with FME'sWMS Readervia the FME Data Inspector or FME Workbench.Return to the blank workspace we created with the WMS Reader.This should be set to use the GetCapabilities Direct URL and in the parameters make sure the transparent background option is selected.Run the workspace out to the Data Inspector,enabling the transparent background will enable you to view your image overlaid on a background map such as Stamen Maps.
Set background map in Tools > FME Options
View the WMS output in FME Data Inspector
Testing using FME Desktop tools means you can see the URLs used in this service in the translation logs,by selecting these they will automatically open in your web browser.FME provides a great deal of information to the workspace author through these logs so should there be a problem with your configuration any errors will be easily identifiable.
Another way to verify your WMS service is to use a GetCapabilities request.The resulting XML stream will serve information about the available functionality of the service including which Layers are available.
Take the GetCapabilities Direct URL and copy it into the address bar of your web browser,before making the request edit the URL to include the following defined parameters after the question mark (?): services=wms&version=1.1.1&request=GetCapabilities.
Your URL should now look like this:
http://
If you have set up your services correctly you will receive:
...
The WMS Service created by this tutorial contains the following operations:
These are the two mandatory operations for creating a WMS and more information on these can be found on theOGC Website: WMS Standard.
The data used here originates from open data made available by theCity of Vancouver,British Columbia.It contains information licensed under the Open Government License - Vancouver.
WMS Tutorials:INSPIRE WMS Tutorial
Performing native spatial queries on database tables using the SQLExecutor
Using the SQLExecutor to do a SQL Join
Performing spatial queries on database tables using the FeatureReader
Executing a Stored Procedure on Microsoft SQL Server with FME
Splitting SQL statements using the FME_SQL_DELIMITER directive
The SQLCreator and SQLExecutor Transformers
Writing custom data types to an Oracle table
© 2019 亚搏在线Safe Software Inc |Legal