public int getLength(Object geometry) { MultiPolygon multi; if (geometry instanceof MultiPolygon) { multi = (MultiPolygon) geometry; } else { multi = geometryFactory .createMultiPolygon(new Polygon[] { (Polygon) geometry }); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } int npoints = multi.getNumPoints(); int length; if (shapeType == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException( "Expected ShapeType of Polygon, got " + shapeType); } return length; }
@Override public int getLength(Object geometry) { MultiPolygon multi; if (geometry instanceof MultiPolygon) { multi = (MultiPolygon) geometry; } else { multi = geometryFactory.createMultiPolygon(new Polygon[]{(Polygon) geometry}); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } int npoints = multi.getNumPoints(); int length; if (shapeType == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException( "Expected ShapeType of Polygon, got " + shapeType); } return length; }
public int getLength(Object geometry) { MultiPolygon multi; if (geometry instanceof MultiPolygon) { multi = (MultiPolygon) geometry; } else { multi = geometryFactory .createMultiPolygon(new Polygon[] { (Polygon) geometry }); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } int npoints = multi.getNumPoints(); int length; if (shapeType == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException( "Expected ShapeType of Polygon, got " + shapeType); } return length; }
int npoints = multi.getNumPoints(); int length;
public int getLength(final Object _geometry) { MultiPolygon multi; if (_geometry instanceof MultiPolygon) { multi = (MultiPolygon) _geometry; } else { multi = geometryFactory_.createMultiPolygon(new Polygon[] { (Polygon) _geometry }); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } final int npoints = multi.getNumPoints(); int length; if (shapeType_ == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType_ == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType_ == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException("Expected ShapeType of Polygon, got " + shapeType_); } return length; }
@Override public int getLength(Object geometry) { MultiPolygon multi; if (geometry instanceof MultiPolygon) { multi = (MultiPolygon) geometry; } else { multi = geometryFactory.createMultiPolygon(new Polygon[]{(Polygon) geometry}); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } int npoints = multi.getNumPoints(); int length; if (shapeType == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException( "Expected ShapeType of Polygon, got " + shapeType); } return length; }
final int npoints = multi.getNumPoints();
@Override public int getLength(Object geometry) { MultiPolygon multi; if (geometry instanceof MultiPolygon) { multi = (MultiPolygon) geometry; } else { multi = geometryFactory.createMultiPolygon(new Polygon[]{(Polygon) geometry}); } int nrings = 0; for (int t = 0; t < multi.getNumGeometries(); t++) { Polygon p; p = (Polygon) multi.getGeometryN(t); nrings = nrings + 1 + p.getNumInteriorRing(); } int npoints = multi.getNumPoints(); int length; if (shapeType == ShapeType.POLYGONZ) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16 + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGONM) { length = 44 + (4 * nrings) + (16 * npoints) + (8 * npoints) + 16; } else if (shapeType == ShapeType.POLYGON) { length = 44 + (4 * nrings) + (16 * npoints); } else { throw new IllegalStateException( "Expected ShapeType of Polygon, got " + shapeType); } return length; }
final int npoints = multi.getNumPoints();
int npoints = multi.getNumPoints();
final int npoints = multi.getNumPoints();
private static byte[] serialize(MultiPolygon multiPolygon) { int numPolygons = multiPolygon.getNumGeometries(); int numPoints = multiPolygon.getNumPoints(); int numRings = 0; for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); numRings += polygon.getNumInteriorRing() + 1; } ByteBuffer buffer = newBuffer(calculateBufferSize(numPoints, numRings)); putHeader(buffer, ShapeType.POLYGON, numPoints, numRings); int offset = 0; for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); offset = putRingOffsets(buffer, polygon, offset); } for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); putPolygonPoints(buffer, polygon); } return buffer.array(); }
private static byte[] serialize(MultiPolygon multiPolygon) { int numPolygons = multiPolygon.getNumGeometries(); int numPoints = multiPolygon.getNumPoints(); int numRings = 0; for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); numRings += polygon.getNumInteriorRing() + 1; } ByteBuffer buffer = newBuffer(calculateBufferSize(numPoints, numRings)); putHeader(buffer, ShapeType.POLYGON, numPoints, numRings); int offset = 0; for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); offset = putRingOffsets(buffer, polygon, offset); } for (int i = 0; i < numPolygons; i++) { Polygon polygon = (Polygon) multiPolygon.getGeometryN(i); putPolygonPoints(buffer, polygon); } return buffer.array(); }
int npoints = multi.getNumPoints();
int npoints = multi.getNumPoints();
int npoints = multi.getNumPoints();