Exercise 5 | |
Data | Orthophoto images (GeoTIFF) |
Overall Goal | Create an FME Server Data Download system for orthophotos |
Demonstrates | Handling selection by geographic area |
Start Workspace | C:\FMEData2016\Workspaces\ServerAuthoring\SelfServe-Ex5-Begin.fmw |
End Workspace | C:\FMEData2016\Workspaces\ServerAuthoring\SelfServe-Ex5-Complete.fmw |
As a technical analyst in the GIS department of a city you have just commenced a project to allow other departments to download orthophoto data, rather than having to ask you to create it for them. Not only will their requests be processed quicker, you will also spend less time on that task.
You've implemented a lot of different options for transformation, format, coordinate system, and layers to process. However, end-users also often ask for raster data for a particular neighborhood of the city, and that's easy to do using a Clipper transformer.
1) Open Workspace
Open the workspace from exercise 4, or the begin workspace listed above. You can see that it consists of a Reader, two Writers, three transformers, and various published parameters.
To clip data to a particular neighborhood first requires a Reader for those neighborhood features, so that is the first step...
2) Add Reader
Select Readers > Add Reader and use the following setup:
Reader Format | Google KML |
Reader Dataset | C:\FMEData2016\Data\Boundaries\VancouverNeighborhoods.kml |
When prompted, select only the feature type for Neighborhoods:
Once added, remove the published parameter for SourceDataset_OGCKML. We don't need to prompt to user to select this dataset.
3) Add Published Parameter
Currently the KML Reader will read all of the neighborhoods. However, we need the user to select one of these to clip the data with. To select the neighborhood we'll use a published parameter.
So, add a new parameter. Set the parameter values as follows:
Type | Choice |
Name | Neighborhood |
Published | Yes |
Optional | Yes |
Prompt | Select the Neighborhood |
For the configuration field, click the [...] browse button. In the dialog that opens, enter the names of the neighborhoods of Vancouver. These are:
- Downtown
- Fairview
- Kitsilano
- Mount Pleasant
- Strathcona
- West End
Notice that this parameter is optional. The user should not have to select a value if they don't want to. Also, this is a choice field alone; an alias is not needed because the proper values are clear enough.
4) Add Tester
Now we need to filter the neighborhood data by the user's choice. So add a Tester transformer to the workspace, connected to the Neighborhood feature type:
Open the parameters dialog and set up the parameters to test where NeighborhoodName = the neighborhood published parameter:
Click OK to close the dialog.
5) Add CsmapReprojector
One interesting part of the neighborhood dataset is that it is in a Latitude/Longitude coordinate system, whereas all other data is in UTM83-10. To be able to clip one with the other requires both datasets to be in the same coordinate space.
So, place a CsmapReprojector transformer after the Tester, connected to the Tester:Passed port. Set it up to reproject to UTM83-10
Professor Spatial F.M.E., E.T.L. says... |
Why does the CsmapReprojector come after the Tester? Because it has less work to do. If the data was reprojected first then we would be reprojecting data that is subsequently filtered out. It might only be a small difference here, but this is the type of detail that really helps workspace performance in larger projects. |
6) Add Clipper
Now to clip the raster data. Add a Clipper transformer to the workspace. Connect the CsmapReprojector to the the Clipper:Clipper port. Connect the output from the VectorOnRasterOverlayer to the Clipper:Clippee port:
Check the parameters. The only parameter to change is one specifically related to raster data: Preserve Clippee Extents. Set this parameter to No and click OK to close the dialog.
7) Publish to FME Server
Save the workspace, publish it to FME Server, and run it. You should now be able to choose all source tiles and clip them to a chosen neighborhood, like so (here, the Downtown neighborhood):
CONGRATULATIONS |
By completing this exercise you have learned how to:
|