Friday 29 April 2011

The Safe FME World Tour

So I’ve spent most of the day in Leeds, attending one of the stops in the Safe FME “World Tour” event. I’m familiar with the name of the FME product – it gets mentioned a lot on the SQL Server MSDN forums as the ETL tool of choice to fix all manner of spatial data loading/conversion problems – but I’ve never actually used it until very recently.

Then, last month, I had some email contact with Don Murray, the president of Safe, and he mentioned he was coming to do two FME events in the UK and would I like to come along. And I’m glad I accepted his offer. The event was very well organised and hosted (courtesy of Dotted Eyes – Safe’s primary UK partner), with some great speakers and a good mix of sessions. The day featured some “Show ‘n’ Tell” slots (as we did at the last Bing Maps UK Usergroup meeting) from the likes of the British Geological Survey and the London 2012 Olympic Games amongst others. I always find it interesting to see what other folks are doing with their spatial data, as well as the problems they’ve faced along the way. There was some nice eye-candy too, primarily courtesy of some Google Earth network links to FME Server and 3D surface models in Adobe Acrobat.

What I found most interesting though is that, despite having never used FME before, it all felt surprisingly familiar. The FME workbench, where you design spatial ETL tasks, will look very familiar to any SQL Server developers who have ever created a SSIS package – you drag various sources, destinations, and transformation elements onto the page, connected into a logical workflow, and you can define environment variables, conditional steps, counters etc. Likewise, the function of the transformers themselves felt very familiar – many of them corresponding directly to OGC methods defined by the geometry and geography datatypes in SQL Server. For example:
  • The Clipper function basically determines the STIntersection() between two geometries.
  • DonutBuilder subtracts one Polygon from another, a la STDifference().
  • The ConxexHullReplacer is STConvexHull().
  • BoundingBoxReplacer? That’s STEnvelope().
  • And CenterOfGravityReplacer is STCentroid().
  • Bufferer is, unsurprisingly, STBuffer().
  • etc.
Some of the slightly more complex transformers have no simple direct equivalent method in SQL Server, but can be created fairly easily in a SQLCLR procedure using the SqlGeometryBuilder or SqlGeographyBuilder classes. LineCloser, for example, turns LineStrings into Polygons by setting the end point equal to the start point. Offsetter adds constant offsets to each coordinate value, rather like the GeometryShifter SqlGeometryBuilder demo by Isaac Kunen.

In fact, Don noted at one point that “FME’s biggest competitor is people writing their own code”. Essentially, all spatial operations (including those performed by FME’s transformers) can be reduced to geometric problems, and solved using mathematics that can be written in almost any programming language – C++, C#, Javascript… but the question is whether you really have the time or inclination to write your own code to import data from OSM, generate a Bing Maps tile layer, drape a raster image over a TIN surface, or triangulate a set of points, when Safe have done that work already?

No comments:

Post a Comment

Share This Post