private static Polygon getSubPolygon(Polygon polygon, int startIndex, int endIndex) { Polyline boundary = new Polyline(); boundary.startPath(polygon.getPoint(startIndex)); for (int i = startIndex + 1; i < endIndex; i++) { Point current = polygon.getPoint(i); boundary.lineTo(current); } final Polygon newPolygon = new Polygon(); newPolygon.add(boundary, false); return newPolygon; }
public static Slice stLineString(@SqlType("array(" + GEOMETRY_TYPE_NAME + ")") Block input) MultiPath multipath = new Polyline(); OGCPoint previousPoint = null; for (int i = 0; i < input.getPositionCount(); i++) {
@Description("Returns the Geometry value that represents the point set intersection of two Geometries") @ScalarFunction("ST_Intersection") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stIntersection(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right) { if (deserializeType(left) == GeometrySerializationType.ENVELOPE && deserializeType(right) == GeometrySerializationType.ENVELOPE) { Envelope leftEnvelope = deserializeEnvelope(left); Envelope rightEnvelope = deserializeEnvelope(right); // Envelope#intersect updates leftEnvelope to the intersection of the two envelopes if (!leftEnvelope.intersect(rightEnvelope)) { return EMPTY_POLYGON; } Envelope intersection = leftEnvelope; if (intersection.getXMin() == intersection.getXMax()) { if (intersection.getYMin() == intersection.getYMax()) { return serialize(createFromEsriGeometry(new Point(intersection.getXMin(), intersection.getXMax()), null)); } return serialize(createFromEsriGeometry(new Polyline(new Point(intersection.getXMin(), intersection.getYMin()), new Point(intersection.getXMin(), intersection.getYMax())), null)); } if (intersection.getYMin() == intersection.getYMax()) { return serialize(createFromEsriGeometry(new Polyline(new Point(intersection.getXMin(), intersection.getYMin()), new Point(intersection.getXMax(), intersection.getYMin())), null)); } return serialize(intersection); } OGCGeometry leftGeometry = deserialize(left); OGCGeometry rightGeometry = deserialize(right); verifySameSpatialReference(leftGeometry, rightGeometry); return serialize(leftGeometry.intersection(rightGeometry)); }
public OGCMultiLineString(SpatialReference sr) { polyline = new Polyline(); esriSR = sr; }
Polyline p = new Polyline(); List<GeoPoint> pts = new ArrayList<GeoPoint>(); //add your points here p.setPoints(pts); //add to map Marker m = new Marker(mapView); m.setTitle("Some text here"); //must set the icon last m.setIcon(null); m.setPosition(new GeoPoint(marker location here)); //add to map
@Override public OGCMultiCurve boundary() { Polyline polyline = new Polyline(); polyline.add(polygon, true); // adds reversed path return (OGCMultiCurve) OGCGeometry.createFromEsriGeometry(polyline, esriSR, true); }
@Override public OGCGeometry boundary() { Polyline polyline = new Polyline(); polyline.add(polygon, true); // adds reversed path return (OGCMultiCurve) OGCGeometry.createFromEsriGeometry(polyline, esriSR, true); }
@Override public OGCGeometry reduceFromMulti() { int n = numGeometries(); if (n == 0) { return new OGCLineString(new Polyline(polyline.getDescription()), 0, esriSR); } if (n == 1) { return geometryN(0); } return this; }
public OGCLineString(MultiPath mp, int pathIndex, SpatialReference sr) { multiPath = new Polyline(); if (!mp.isEmpty()) multiPath.addPath(mp, pathIndex, true); esriSR = sr; }
@Override public OGCGeometry reduceFromMulti() { int n = numGeometries(); if (n == 0) { return new OGCLineString(new Polyline(polyline.getDescription()), 0, esriSR); } if (n == 1) { return geometryN(0); } return this; }
public OGCLineString(MultiPath mp, int pathIndex, SpatialReference sr, boolean reversed) { multiPath = new Polyline(); if (!mp.isEmpty()) multiPath.addPath(mp, pathIndex, !reversed); esriSR = sr; }
public OGCLineString(MultiPath mp, int pathIndex, SpatialReference sr) { multiPath = new Polyline(); if (!mp.isEmpty()) multiPath.addPath(mp, pathIndex, true); esriSR = sr; }
public OGCLineString(MultiPath mp, int pathIndex, SpatialReference sr, boolean reversed) { multiPath = new Polyline(); if (!mp.isEmpty()) multiPath.addPath(mp, pathIndex, !reversed); esriSR = sr; }
@Override public OGCMultiCurve boundary() { Polyline polyline = new Polyline(); polyline.add(polygon, true); // adds reversed path return (OGCMultiCurve) OGCGeometry.createFromEsriGeometry(polyline, esriSR, true); }
@Override public OGCGeometry boundary() { Polyline polyline = new Polyline(); polyline.add(polygon, true); // adds reversed path return (OGCMultiCurve) OGCGeometry.createFromEsriGeometry(polyline, esriSR, true); }
private Geometry densifySegment(Segment geom) { double length = geom.calculateLength2D(); if (length <= m_maxLength) return (Geometry) geom; Polyline polyline = new Polyline(geom.getDescription()); polyline.addSegment(geom, true); return densifyMultiPath((MultiPath) polyline); }
private Geometry densifySegment(Segment geom) { double length = geom.calculateLength2D(); if (length <= m_maxLength) return (Geometry) geom; Polyline polyline = new Polyline(geom.getDescription()); polyline.addSegment(geom, true); return densifyMultiPath((MultiPath) polyline); }
static Polyline invert(Polyline geometry) { Polyline reverse = new Polyline(); int last = geometry.getPointCount() - 1; reverse.startPath(geometry.getPoint(last)); for (int i = last - 1; i >= 0; --i) { reverse.lineTo(geometry.getPoint(i)); } return reverse; }
private static Polygon getSubPolygon(Polygon polygon, int startIndex, int endIndex) { Polyline boundary = new Polyline(); boundary.startPath(polygon.getPoint(startIndex)); for (int i = startIndex + 1; i < endIndex; i++) { Point current = polygon.getPoint(i); boundary.lineTo(current); } final Polygon newPolygon = new Polygon(); newPolygon.add(boundary, false); return newPolygon; }
private static Polygon getSubPolygon(Polygon polygon, int startIndex, int endIndex) { Polyline boundary = new Polyline(); boundary.startPath(polygon.getPoint(startIndex)); for (int i = startIndex + 1; i < endIndex; i++) { Point current = polygon.getPoint(i); boundary.lineTo(current); } final Polygon newPolygon = new Polygon(); newPolygon.add(boundary, false); return newPolygon; }