Question

could not be converted from Well Known Binary format to geometry

  • 31 May 2013
  • 4 replies
  • 42 views

Hi All,

 

I am using a reader that is connecting to Microsoft SQL Server Spatial if I connect an Inspector and run in the workbench, I get the following error on some (not all) of the data. Can anyone shed some light why this might be happening? As far as I can tell the spatial data is fine and the missing data does show in other applications such as CAD and ArcGIS (using a view) and in SQL Server Management Studio itself.

 

 

  MS SQL Server (Spatial) Reader: Failed to write to the database because it could not be converted from Well Known Binary format to geometry MS SQL Server (Spatial) Reader: Failed to deserialize SQL Server geography binary: `0xBB100000020411000000D91B626FD3E43AC0D0F4B58B2AD062405D25081ED0E43AC03F9DA6BD2AD06240C0AC0D81CEE43AC0CCD91FF92AD06240CCB6CE8ACEE43AC03318DE472BD062409A332FC4D9E43AC0DFD2A9FD2ED06240147DD465DEE43AC0D7CD11A52FD0624066497962E5E43AC084BC4EA62FD06240AAFAF5E1F8E43AC04A1CD2802ED06240B0122D36FBE43AC067BC3B812ED06240931464C1FCE43AC0691909B92ED0624047C1F932FEE43AC061FA33332FD06240C278857B09E53AC01511DFDF30D06240114E34ED1AE53AC07C78261231D06240DFC92730F7E53AC0BB26A2A627D06240F18D0FC3FBE53AC0EA429E7B27D062408B5AC76F00E63AC0F7F2B15D27D062407965D8237AE63AC0F68A900525D0624001000000030000000001000000FFFFFFFF00000000090B0000000203000100010001000100'

4 replies

Userlevel 4
Hi,

 

 

there is a slight chance that MSSQL either isn't fully OGC compliant or that it allows geometries that cannot be fully represented using the WKB/WKT standard.

 

 

I tried to use FME to parse the geometry string you posted, but no luck.

 

 

It would be interesting if you could try to serialize the geometry as WKT (text) so that we can see what it contains. You could do it using a SQLCreator with a statement like:

 

 

select shape.STAsText() as WKT from <your tablename> where objectid = <the id of a problematic feature>

 

 

Send the output to a logger and post the output here.

 

 

David
Badge +7

I had a similar problem involving WKB data from SQL Server which I solved by removing the "0x" from the start of the value, then converting it to geometry using the GeometryReplacer with Geometry Encoding set to "Hex Encoded OGC Well Known Binary". The GeometryExtractor can then be used to convert the newly created Geometry to text e.g. by specify "OGC Well Known Text" as the Geometry Encoding in GeometryExtractor.

Badge +7

I had a similar problem involving WKB data from SQL Server which I solved by removing the "0x" from the start of the value, then converting it to geometry using the GeometryReplacer with Geometry Encoding set to "Hex Encoded OGC Well Known Binary". The GeometryExtractor can then be used to convert the newly created Geometry to text e.g. by specify "OGC Well Known Text" as the Geometry Encoding in GeometryExtractor.

I've just had the same problem occur again and found my own post as the solution!

 

 

Userlevel 6
Badge +32
I've just had the same problem occur again and found my own post as the solution!

 

 

lol, search works like it should then :)

Reply