org.geolatte.geom.codec.HANAWkbDialect 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.*;
class HANAWkbDialect extends WkbDialect {
final public static HANAWkbDialect INSTANCE = new HANAWkbDialect();
private HANAWkbDialect() {
}
@Override
boolean emptyPointAsNaN() {
return false;
}
@Override
GeometryType parseType(long tpe) {
return super.parseType((tpe & 0xFFFF) % 100);
}
protected int calculateSize(Geometry
geom, boolean includeSrid) {
int size = 1 + ByteBuffer.UINT_SIZE; //size for order byte + type field
if (includeSrid) {
size += 4;
}
if (geom.isEmpty()) return size + ByteBuffer.UINT_SIZE;
return size + geometrySize(geom);
}
@Override
BaseWkbVisitor
mkVisitor(Geometry
geom, ByteOrder bo) {
return new HANAWkbVisitor<>(mkByteBuffer(geom, bo), this);
}
}