org.geolatte.geom.codec.Sfa110WkbDialect 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.ByteBuffer;
import org.geolatte.geom.ByteOrder;
import org.geolatte.geom.Geometry;
import org.geolatte.geom.Position;
class Sfa110WkbDialect extends WkbDialect {
public final static Sfa110WkbDialect INSTANCE = new Sfa110WkbDialect();
protected Sfa110WkbDialect() {
}
protected int getPositionSize(Geometry
geom) {
return 2 * ByteBuffer.DOUBLE_SIZE;
}
@Override
BaseWkbVisitor
mkVisitor(Geometry
geom, ByteOrder bo) {
ByteBuffer buffer = mkByteBuffer(geom, bo);
return new SFA110WkbVisitor<>(buffer, this);
}
}
class SFA110WkbVisitor
extends BaseWkbVisitor
{
SFA110WkbVisitor(ByteBuffer byteBuffer, WkbDialect dialect) {
super(byteBuffer, dialect);
}
@Override
protected void writePoint(double[] coordinates, ByteBuffer output) {
output.putDouble(coordinates[0]);
output.putDouble(coordinates[1]);
}
}