290 likes | 455 Views
Customizing SpatialDirect Ken Bragg, Safe Software, Vancouver, BC. v. FME Worldwide User Conference - Vancouver. Sep. 21-22, 2006. Customizing SpatialDirect. Goals Provide a brief overview of SpatialDirect customization
E N D
Customizing SpatialDirectKen Bragg, Safe Software, Vancouver, BC v FME Worldwide User Conference - Vancouver Sep. 21-22, 2006
Customizing SpatialDirect Goals • Provide a brief overview of SpatialDirect customization • Provide attendees with a starting point for doing your own customization
Architecture Diagram Web Front End Mapping File Development RemoteFetchUrl Interface Custom Client
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
Web Front End Default Order From • Dynamically Generated by TranslationServlet • Provided as Sample
Web Front End Customized Order Form with ArcIMS Integration City of Kamloops
Web Front End Data Extract Wizard for Geocortex IMF (Latitude Geographics)
Web Front End • Shopping Cart Approach (State of Arkansas)
Web Front End • Shopping cart approach (State of Arkansas)
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
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
TranslationServletRemoteFetchUrl Interface Web Front End Mapping File Development RemoteFetchUrl Interface Custom Client
Translation Servlet 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
QServer Client Web Front End Mapping File Development RemoteFetchUrl Interface Custom Client
QServer QServer - Configured Using SDManager • Prepares jobs for FME and queues them • Load balancing • Dynamic resource addition • APIs for Java, C++, C#
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
Mapping File Development Web Front End Mapping File Development RemoteFetchUrl Interface Custom Client
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
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
Mapping File Example Generalize Suppose 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
Mapping File Example Notes: • The theme is named by the datasource_themeName • The TOLERANCE parameter is a macro you can set in the remoteFetchURL Example. …&fmeParams=--TOLERANCE+2 • Don’t forget to set the default macro in the mapping file
Queriers • Query factories can be used in mapping files to query a database • Allows us to leverage powerful database query capacity
Queriers • ArcSDEQuerier & OracleQuerier get syntax from FME Workbench
Workspaces & Custom Formats • Can use a Workbench Custom Format as a datasource • Can use Workspace as a destination