February 11th, 2009
New Format: GPX Writing
New for FME2009: Raster Clipping
Tip of the Day: Redirects
Mashup Example: Parcel Tracking
FME Worldwide User Conference 2009
In 1968 the National Film Board of Canada (NFB) made a film called Data for Decision.
It’s an historic film that directly relates to the rise of GIS and spatial data worldwide. It’s about a Canadian project called The Canada Geographic Information System ; essentially the forerunner to modern GIS.
At a time when debate (after debate, after debate) takes place on geospatial infrastructures being pitched to various governments as a means to stimulate the economy, it’s well worth looking back at this project: to see how it stimulated GIS use and to examine the reasons why GIS is so good at what it does.
And to tie it into a Safe Software angle, FME is the perfect engine for powering GIS because it provides instant access to widely disparate datasets, of the sort you need to reconcile to make informed decisions. Plus it’s a great tool for harmonizing data for spatial data infrastructures. Check out the case studies on Safe’s web site for some examples of such projects.
New Format: GPX Writing
The ability to read GPX data - a generic GPS data exchange format - has been included in FME for some time now. However FME2009 introduces the ability to also write this format of data. This means a user can now convert GPS-recorded data into another spatial format, and convert data of another spatial format into a form usable in a GPS.
Like most XML-based formats, a GPX writer has a number of pre-defined feature types for different XML tags.
The simplest feature type is metadata. Commonly you could create a null geometry feature (with a Creator transformer) and a set of attributes (with an AttributeCreator) and send this information into the output as a set of metadata. Constants are another way to define these (below):
The other feature types are Tracks, Routes and Waypoints.
A waypoint is a point of interest or specific feature. It has its own set of attributes such as precision metadata. A Route is a series of Waypoints. A Track is a series of recorded points which form a path, but don’t necessarily represent a specific feature. I imagine that when you download data from a GPS, you would have a Track (a series of recorded points); but when you convert to GPX for upload into a GPS, you would usually upload a Route.
Here’s a simple workspace with both metadata and waypoints feature types being used:
When run this results in an output with the defined metadata:
<metadata> <name>Interopolis Landmarks</name> <desc>A set of point features representing landmarks in the City of Interopolis</desc> <author> <name>Mark Ireland</name> <email>firstname.lastname@example.org</email></author> <copyright author="Safe Software"> <year>2009</year></copyright> <keywords>FME Training Interopolis Landmarks</keywords> <bounds minlat="30.154433" minlon="-98.044379" maxlat="30.525043" maxlon="-97.395088"/> </metadata>
…and a series of waypoint definitions like this:
<wpt lon="-97.708402" lat="30.311383"> <name>Cameron Village</name> <src>K</src> </wpt> <wpt lon="-97.740276" lat="30.361204"> <name>Creekside Square</name> <src>K</src> </wpt>
So what’s a good use-case for this? Well, do you remember the election-sign project I’ve talked about previously? Creating maps for folk to navigate to place/pick-up election signs was a big advance anyway. But now I could convert that sign data into GPX, upload it onto my Blackberry GPS, and have it navigate me round from sign location to sign location in the most efficient route.
How cool would that be?
New for 2009: Raster Clipping
FME2008 did raster clipping, but it relied on temporary functionality in the ClippingFactory.
For FME2009, we have a new RasterClippingFactory - which is incorporated into the Clipper transformer - that now takes care of all raster clipping. This provides two key benefits:
a) Non-Rectangular Clipping
The new factory support non-rectangular clipping. In other words rasters can be cut up into unusual shapes, as shown below:
As a raster is rectangular in shape, the area around the clipped content is marked as nodata, as shown below:
b) Raster Features as a Clip Boundary
The main use case for raster clipping support is to clip rasters - but the reverse is now also possible: a raster feature can now be used as the clip boundary itself.
Above: Vector features clipped out by a raster clipper. There are more complex rules for clipping raster against raster, so it’s worth checking out the transformer help to see what the “Preserve Clippee Extents” option does.
Tip of the Day: Redirects
One of the most useful functions in Workbench is the ability to preview the output of a translation by running it with “Redirect to Visualizer” turned on.
However, one of the most annoying things to happen is forgetting to turn off the redirect before running the translation for real!
At Safe, we already put a huge message into the log file (below), so you can see this is what has happened, and we plan to add a warning message when saving a workspace in that state.
What can you do? Well this tip might help.
The tip is that not only is Redirect to Visualizer available in the menubar and in the Navigator pane, it’s also available as a toolbar button. However, by default you have to customize the toolbar to see it. Here’s how:
Step 1: Right-click in the toolbar and choose “Customize Toolbar…”
Step 2: Locate the tool “Redirect to Visualizer”
Step 3: Drag the “Redirect to Visualizer” tool onto the toolbar:
Step 4: Always check the state of the button before running a translation as a visual check whether you have “Redirect to Visualizer” turned on.
The other useful thing here is that it’s quicker to use this button to turn the redirect on and off, than going through the Navigator pane. And don’t forget to explore all of the other tools that are available for adding to the toolbar (Prompt and Run is also very useful).
Mashup Example: Parcel Tracking
Having just ordered a new computer from an online retailer, I’ve been hitting the UPS website every day (more like every ten minutes), to find out exactly whereabouts it is and when it might actually be delivered.
But the website information was a bit sketchy - I have no idea where Concord, ON is - so I thought why not use FME? With FME I can scrape location information from the UPS web site, geocode it, and write it out to KML for viewing in Google Earth.
So that’s what I did. It took about an hour’s worth of work. But now, instead of the UPS website display (click for the full image):
…I can now use FME to generate a spatial display (click for the full image):
OK. Tracking parcels might not be your main work role, and it’s not like it can see real-time info about UPS truck locations, but I post this example because it shows how remarkably simple it is to create an FME workspace that scrapes data directly from a web site, and how easily that data can be used to create a map-based output.
Here’s the workspace (click for the full image). It’s not exactly huge, and the Geocoding custom transformer is a good example of re-using prior work.
It’s set up so that you can either enter a single tracking number, or read a list of several numbers from a text file.
Furthermore, in a matter of seconds I can upload the workspace to an FME Server and register it as a KML network link service. Then I have an online parcel tracking system that will update itself automatically!
You can find the workspace - and an explanation of each step - on fmepedia.
This year’s event will feature keynote speaker James Fee plus informative workshops, breakout sessions, and more.
Also, you can arrive early and take additional training classes and workshops.
Take advantage of early bird savings by registering before April 3rd - visit www.fmeuc.com for further details and to register today!
The call for presentations is also now open. Please review our presentation guidelines for details and then submit your abstract through our online form. The deadline for submissions is February 27, 2009.
The Monday/Tuesday (8th/9th June) has basic FME Desktop and FME Server training available - at a “significantly discounted” rate.
Wednesday sees a whole series of advanced training modules for you to pick and choose from. The most exciting ones (in my opinion) are a session on Dynamic and Generic workspaces, and one on FME for ESRI users.
The conference venue promises to be great, the Roundhouse (location of the Thursday social event) sounds incredible, and even FME Idol will be new and improved to let everyone who wants to join in.
Hope to see you there.
Next Post:In the next post I hope to cover some of our new XQuery functionality, including examples of pulling data out of an XML document, and using XQuery transformers to handle metadata.
“Things are getting strange, I’m starting to worry,
This could be a case for Mulder and Scully”