As many of you have already discovered, the Geography data type in SQL Server 2008 is very strict about the structure of the spatial data which it will accept. The Geometry data type, on the other hand, is much more forgiving about spatial data which does not conform to the rules defined in the OGC Simple Features for SQL Specification. In fact, the Geography data type will not allow non-compliant spatial data to be inserted into the database. Identifying such “bad” data and isolating it for further editing is the first step in getting resolving this issue.

Yesterday, Safe Software released its latest FME 2009 beta (Build 5578) which provides, for the first time, the ability to capture data identified by SQL Server 2008 as invalid. Invalid data is now written to the mapping_log.ffs file where if may be used for further processing. I used this new build of FME to load the rather well-known Admin00 Shapefile into the SQL Server Geography data type. In past builds, when FME encountered a SQL Server database error, it would stop processing and fail to load even the valid data currently in the insert buffer. The following image illustrates, in the FME Universal Viewer, data which was loaded into the SQL Server Geography data type (blue) and data which was rejected by the database server and written to the mapping_log.ffs file (orange).


In the next installment, I will attempt to use FME (no guarantees) to correct the rejected data, located in the mapping_log.ffs file, so that it loads into the Geography data type.

Comments (2)

  1. tanoshimi says:

    @Ed – Is it me, or has there not been a "next installment" explaining how to fix the rejected geometries in the Safe FME feature store file? Is that because you never got round to writing it, or you found out it couldn't be done? (You did say "no promises"…)

    I only ask because I'm about to undertake the same task myself with some particularly tricksy geometries that even Denali geography datatype won't accept, so if there's a 3yr old blog post you've got half-written that would save me some time, I'd love to read it 😉

Skip to main content