Sep. 21-22, 2006 v FME Worldwide User Conference - Vancouver Customizing SpatialDirect Ken Bragg, Safe Software, Vancouver, BC
Jan 01, 2016
Sep. 21-22, 2006v FME Worldwide User Conference - Vancouver
Customizing SpatialDirect
Ken Bragg, Safe Software, Vancouver, BC
Customizing SpatialDirect 2
Customizing SpatialDirect
Goals
Provide a brief overview of SpatialDirect customization
Provide attendees with a starting point for doing your own customization
Customizing SpatialDirect 3
Architecture Diagram
Web Front End
Mapping FileDevelopment
Custom ClientRemoteFetchUrlInterface
Customizing SpatialDirect 4
SpatialDirect Components
Management Components SpatialDirect Manager Process Monitor
Production Components Web Front End – Order Form etc.
Custom Webpage Development Translation Servlet
RemoteFetchUrl Interface QServer
Custom Client Using QServer API FME Server
Mapping File Development
Customizing SpatialDirect 5
Web Front End
Default Order From Dynamically
Generated by TranslationServlet
Provided as Sample
Customizing SpatialDirect 6
Customized Order Form
with ArcIMS Integration
City of Kamloops
Web Front End
Customizing SpatialDirect 7
Data Extract Wizard for
Geocortex IMF (Latitude Geographics)
Web Front End
Customizing SpatialDirect 10
Example Order Form Template
Add email address to order form for result notification
Send email address to QServer for email notification
We need to add a text box for the email address to the form and add this email address to the remoteFetchUrl
This is the page we edit:<Web Public Root>\safeViewerHTML\fetchDefault.htm
Customizing SpatialDirect 11
Editing Order Form Template
1) <tr> Email Address: <input type="text“value="" name="notificationemail“size="55“ONCHANGE="updateRemoteFetchURL(document.spatialQuery);“/></tr>
2) Add this the function updateRemoteFetchURL(f) in the section that
builds the remoteFetchUrl
+ "¬ificationEmailAddress=" + f.notificationemail.value
Customizing SpatialDirect 12
TranslationServletRemoteFetchUrl Interface
Web Front End
Mapping FileDevelopment
Custom ClientRemoteFetchUrlInterface
Customizing SpatialDirect 13
Remote Fetch URL Interface Example Remote Fetch URL
http://localhost/SpatialDirect/translationServlet?SSFunction=remoteFetch&queryMethod=dbUnits&lowerLeftX=-124.756&lowerLeftY=45.553&upperRightX=-122.141&upperRightY=47.2785&userSelectedThemes=Volcanoes_wa_shp+states_wa_shp&enableAutoThemeSelection=true&format=2gif.fme&pixels=350&coordsys=BCALB-83&fmeParams=--Tolerance+10
Translation Servlet
Customizing SpatialDirect 14
QServer Client
Web Front End
Mapping FileDevelopment
Custom ClientRemoteFetchUrlInterface
Customizing SpatialDirect 15
QServer
QServer - Configured Using SDManager
Prepares jobs for FME and queues them
Load balancing
Dynamic resource addition
APIs for Java, C++, C#
Customizing SpatialDirect 16
QServer – Client
QServer has APIs for Java, C++, C# for making your own QServer Client
FME Server Client is an example made here at Safe
Customizing SpatialDirect 17
Mapping File Development
Web Front End
Mapping FileDevelopment
Custom ClientRemoteFetchUrlInterface
Customizing SpatialDirect 18
Mapping Files
Allows SpatialDirect to leverage the full range of FME feature processing functions and factories
Allows transformation and customization of output based on user input, themes, attributes etc
Customizing SpatialDirect 19
Mapping File Sequence
2<format>.fme
system.fmi
multisource.fmi
configM ultiSource.tcl
<data_source>.fmi
@ Transform () m ulti-reader features to FM E_G ENERIC
preprocess.fmi
@ Transform () FM E_G ENERIC features to requested output form at
Translation Processing andMapping File INCLUDE Sequence
(Overview )
Customizing SpatialDirect 20
Mapping File Sequence
2<format>.fme
system.fmi
multisource.fm i
Translation Processing and MappingFile INCLUDE Sequence (Part 1)
- Perform output form at specific processing on the requested data- C reate D EF lines if required for the output form at
- Set system w ide M AC R O values- IN C LU D E m ultisource.fm i and preprocess.fm i (ie . contro l file
for system -wide, generic processing for every translation)
- D ynam ica lly configure Spatia lD irect to read from m ultip leuser-defined data sources (through configM ultiSource.tc l)
configMultiSource.tcl
- D ynam ica lly generate m ultiR eaderID M AC R O s, IN C LU D Eand ID s d irectives for m ulti-source data based on therequested them es for each translation
- e .g. M AC R O m ultiR eaderID 3IN C LU D E ${fm eM fD ir}/m ultiSource/user/shpD ata.fm iIN C LU D E ${fm eM fD ir}/m ultiSource/SH APEcom m on.fm ishpD ata_ID s roads rivers
Customizing SpatialDirect 21
Mapping File Sequence
<data_source>.fmi
@ Transform () m ulti-reader features to FM E_G EN ER IC
preprocess.fmi
@ Transform () FM E_G EN ER IC features to requested output form at
Translation Processing and MappingFile INCLUDE Sequence (Part 2)
- O ne <data_source>.fm i file for each source data set- D efine reader database connection / data location, source coord inate
system , m ulti-reader keywords, e tc- e .g. M AC R O SourceD ataset E :\data\shape\world
M AC R O SourceC oordSystem LL83M AC R O R eaderKeyword shapeM U LTI_R EAD ER _TYPE{$(m ultiR eaderID )} SH APEM U LTI_R EAD ER _KEYW O R D {$(m ultiR eaderID )} $(R eaderKeyword)
- Validate them es against config .csv and transferconfig .csv data to each feature
- C lip data to se lected zoom extent- G enerate point / line / po lygon label features- @ R eproject() data to requested output coord inate system
Customizing SpatialDirect 22
Mapping File Customization
First Mapping File is always Exporter for example 2autocad.fmi
Can include your own by adding an include statement eg
INCLUDE <path>\Generalize.fmi
Use Factories and Functions to capture stream of data
Customizing SpatialDirect 23
Mapping File Example
GeneralizeSuppose you want a particular theme generalized for
download
A good place to do this might be PreProcess.fmi
You need a factory to capture the features - use workbench to get the syntax and copy into PreProcess.fmi after the first sampling factory
Customizing SpatialDirect 24
Mapping File Example
Notes:
The theme is named by the datasource_themeName
The TOLERANCE parameter is a macro you can set in the remoteFetchURLExample. …&fmeParams=--TOLERANCE+2
Don’t forget to set the default macro in the mapping file
Customizing SpatialDirect 25
Queriers
Query factories can be used in mapping files to query a database
Allows us to leverage powerful database query capacity