Archive for March, 2008

KML Goodness from the FME User Conference

The FME User Conference is always great value. You get to see interesting presentations, learn about new technologies, and talk to bright people from all across the industry. This last point is probably the most important to me. Mixed in with other great conversations, I got to chat at length with Ed Katibah about SQL Server Spatial, and Don Cooke told me I dressed too well to be a neogeographer :)

It is also the best place to corner an FME developer. I managed to grab Tom Weir, Safe’s KML guru, and go over some of the changes in KML support with FME 2008. During a presentation on the first day of the conference I had included an “easter egg” where I spoke about how to enable active mouse-overs in KML using FME. To my chagrin, after a couple minutes with Tom I realized that my advice was not exactly best practice, and with FME2008 becomes downright ridiculous.

Here’s the before shot from my slide deck (zipped workspace):

Old FME KML StyleMap Workspace

And the after shot once I applied what Tom showed me (zipped workspace):

New FME KML StyleMap Workspace

Obviously, the FME 2008 press release should read: “KML Support in FME: Now with 50% less fat!”

KML FME has been generating multi-geometry for information points for quite some time, so that cuts most of the data wrangling out to generate the info point and merge the features into multi-geometry. And FME 2008 will automatically generate StyleMap elements for you if you follow a couple sneaky tricks.

First, when you create each KMLStyler, set its name to the style ID you want it to receive:

New FME KML StyleMap Workspace - KMLStyler trick

And second, on your geometry set the kml_target_style_normal and kml_target_style_highlight attributes to the IDs that you created in the KMLStylers:

New FME KML StyleMap Workspace - AttributeCreator trick

That gets my embarrassment out of the way, but doesn’t even begin to touch on the extent of KML 2.2 support in FME 2008. Another issue that I have written about is extended data or schema support, and I am happy to say that FME deals with this. Attributes are stored in your output KML as extended data by default, and it is easy to generate a BalloonStyle template. Here’s my first take on this support, which does a great job of separating data from presentation (zipped workspace):

FME KML workspace using balloonstyle

And a quick look at the new basic editor which is included in FME and used for modifying BalloonStyle templates:

FME KML workspace using balloonstyle editor

Which gives us this KML output (source).

There is a going to be a lot more to the KML 2.2 support in FME 2008, including generation of image pyramids for PhotoOverlays, but I’ll leave it to you to explore those on your own.

-J

, , ,

1 Comment

MapGuide Open Source serves up SQL Server Spatial

The recent FDO 3.3.0 release comes with beta support for MS SQL Server Spatial. Adding this provider to MapGuide 2.0.0 on Windows is as simple as copying a few DLLs and updating the XML provider registry.

You’ll have to take my word for it, but all of the layers here are coming from SQL Server 2008:

MapGuide Open Source using SQL Server Spatial 2008

There are a couple small gotchas that I ran into.

If your data contains geometry inconsistencies (basically anything that doesn’t match OGC geometry specs) then the February CTP of SQL Server 2008 will cause spatial queries to fail. Apparently Microsoft may be relaxing this validity requirement in future CTPs, but for now if you have “invalid” geometry, you will have to modify it.

You can find these problems with the GEOM.STIsValid() function and fix them manually, or you can get SQL Server to “fix” the problems with a statement like this:

update dbo.YOURTABLE set GEOM = GEOM.MakeValid();

The second issue was a defect in the provider that causes spatial filters to fail if you set the SRID (spatial reference) on your data. This is because with SQL Server 2008 the SRID of the filter geometry has to match that of the database, and the provider is not setting a SRID for the filter geometry.

For now, you can work around this by removing the SRID from your features with a statement like this:

update dbo.NAN_PARCELS set GEOM.STSrid = 0;

Apart from these two minor glitches, the provider is looking good so far. I’m hoping to get a chance to test it further with later releases of SQL Server 2008 and of the provider to see how well it performs.

If you get a chance to try this out and run into any further problems, please enter a good description of the problem into the FDO Trac issue tracker. The more you test now, the more likely it will work in your production environment later!

-J

P.S. Thanks to Orest at Autodesk for helping me work through these initial issues!

, ,

No Comments

A really Safe place to be…

I’ll be attending and co-presenting with my colleague Matthew Dunstan at the FME Worldwide Users Conference later this week.

I am really looking forward to this conference, and am confident that it will measure up to the outstanding event that Dale, Don, and their team put on in 2006. The technical quality and value for users of FME is truly outstanding, and sets this conference apart from many other industry events.

I’m getting into town on Wednesday night and staying at the conference hotel. Drop me a line if you’re going to be there and want to hang out.

-J

, ,

1 Comment