org.geolatte.geom.codec.PostgisWkbV2Dialect Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geolatte-geom Show documentation
Show all versions of geolatte-geom Show documentation
This geoLatte-geom library offers a geometry model that conforms to the OGC Simple Features for SQL
specification.
The newest version!
package org.geolatte.geom.codec;
import org.geolatte.geom.Geometry;
import org.geolatte.geom.GeometryType;
import org.geolatte.geom.Position;
class PostgisWkbV2Dialect extends PostgisWkbV1Dialect {
final public static PostgisWkbV2Dialect INSTANCE = new PostgisWkbV2Dialect();
@Override
boolean emptyPointAsNaN() {
return true;
}
@Override
protected Long geometryTypeCode(Geometry
geometry) {
if (geometry.isEmpty() && geometry.getGeometryType() == GeometryType.POINT) {
return (long) WKB_POINT;
}
return super.geometryTypeCode(geometry);
}
}