All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geolatte.geom.codec.HANAWkbDialect Maven / Gradle / Ivy

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; if (geom instanceof AbstractGeometryCollection) { size += sizeOfGeometryCollection((AbstractGeometryCollection) geom); } else if (geom instanceof Polygon) { size += getPolygonSize((Polygon

) geom); } else if (geom instanceof Point) { size += getPositionSize(geom); } else { size += ByteBuffer.UINT_SIZE; //to hold number of points size += getPositionSize(geom) * geom.getNumPositions(); } return size; } @Override

BaseWkbVisitor

mkVisitor(Geometry

geom, ByteOrder bo) { return new HANAWkbVisitor

(mkByteBuffer(geom, bo), this); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy