GeoLatte / geolatte-geom

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

BufferAccessException store LINESTRING EMPTY in MySqlWkbEncoder #147

Closed nigelsim closed 2 years ago

nigelsim commented 2 years ago

Hi, I get the following error when trying to store an empty LINESTRING. The GeoDB encoder works correctly.

org.geolatte.geom.BufferAccessException: null
        at org.geolatte.geom.ByteBuffer.putUInt(ByteBuffer.java:404)
        at org.geolatte.geom.codec.BaseWkbVisitor.visit(BaseWkbVisitor.java:80)
        at org.geolatte.geom.LineString.accept(LineString.java:114)
        at org.geolatte.geom.codec.MySqlWkbEncoder.encode(MySqlWkbEncoder.java:42)
        at org.hibernate.spatial.dialect.mysql.MySQLGeometryTypeDescriptor$1.doBind(MySQLGeometryTypeDescriptor.java:61)
maesenka commented 2 years ago

That is not good. But you should know that per documentation: "The only valid empty geometry is represented in the form of an empty geometry collection value. MySQL does not support GIS EMPTY values such as POINT EMPTY."