GeoLatte / geolatte-geom

A geometry model that conforms to the OGC Simple Features for SQL specification.
Other
134 stars 63 forks source link

MS SQL binary format Version 2 should be supported #50

Open falbrech-hsdg opened 7 years ago

falbrech-hsdg commented 7 years ago

With MS SQL Server 2012, JPA 2.1, and a custom AttributeConverter (this is so fancy!), newly created GEOGRAPHY values (via WKT string) are stored using "version 2" of the MS SQL binary format. When trying to decode them after retrieval, I get the error,

java.lang.IllegalStateException: Version mismatch. Expected version 1, but received version 2
    at org.geolatte.geom.codec.db.sqlserver.SqlServerGeometry.parse(SqlServerGeometry.java:304)

In hexadecimal representation, they look like this:

E610000002000C000...

Version 2 of the binary format is documented by Microsoft. It would be great if geolatte included support for this.

maesenka commented 7 years ago

This is not merely a matter of format. The Version 2 geometries/geographies supports feature types such as CircularString, CompoundCurve, etc. which are (currently) not supported by Geolatte-geom. So I would first need to find the time to properly extend the Geometry model of geolatte-geom, and only then will I be able to support version 2.