private static <P extends Position> MultiPoint to(org.geolatte.geom.MultiPoint<P> multiPoint, GeometryFactory gFact) { Point[] points = new Point[multiPoint.getNumGeometries()]; for (int i = 0; i < multiPoint.getNumGeometries(); i++) { points[i] = to(multiPoint.getGeometryN(i), gFact); } return gFact.createMultiPoint(points); }
public void visit(MultiPoint collection, int parent) { Shape shape = new Shape(); shape.type = MULTI_POINT; shape.figureOffset = figures.size(); shape.parentOffset = parent; shapes.add(shape); parent = shapes.size() - 1; for (int i = 0; i < collection.getNumGeometries(); i++) { visit(collection.getGeometryN(i), parent); } }
public void visit(MultiPoint collection, int parent) { Shape shape = new Shape(); shape.type = MULTI_POINT; shape.figureOffset = figures.size(); shape.parentOffset = parent; shapes.add(shape); parent = shapes.size() - 1; for (int i = 0; i < collection.getNumGeometries(); i++) { visit(collection.getGeometryN(i), parent); } }
@Override @SuppressWarnings("unchecked") public <P extends Position, G extends Geometry<P>> SDOGeometry encode(G geom) { final int dim = geom.getCoordinateDimension(); final int lrsDim = getLRSDim(geom); final boolean isLrs = (lrsDim != 0); MultiPoint<P> multiPoint = (MultiPoint<P>) geom; final ElemInfo info = new ElemInfo(multiPoint.getNumGeometries()); int oordinatesOffset = 1; Double[] ordinates = new Double[]{}; for (int i = 0; i < multiPoint.getNumGeometries(); i++) { info.setElement(i, oordinatesOffset, ElementType.POINT, 0); ordinates = addOrdinates(ordinates, pointToOrdinates(multiPoint, i)); oordinatesOffset = ordinates.length + 1; } return new SDOGeometry(new SDOGType(dim, lrsDim, TypeGeometry.MULTIPOINT), geom.getSRID(), null, info, new Ordinates(ordinates)); }