protected Geometry createSubGeomInstance(String token, boolean haveM) throws SQLException { return new Polygon(token, haveM); }
protected Geometry createSubGeomInstance(String token, boolean haveM) throws SQLException { return new Polygon(token, haveM); }
private Polygon parsePolygon(ValueGetter data, boolean haveZ, boolean haveM) { int count = data.getInt(); LinearRing[] rings = new LinearRing[count]; for (int i = 0; i < count; i++) { rings[i] = parseLinearRing(data, haveZ, haveM); } return new Polygon(rings); }
private Polygon parsePolygon(ValueGetter data, boolean haveZ, boolean haveM) { int count = data.getInt(); LinearRing[] rings = new LinearRing[count]; for (int i = 0; i < count; i++) { rings[i] = parseLinearRing(data, haveZ, haveM); } return new Polygon(rings); }
/** * Creates a PostGIS Polygon object corresponding to the provided Point * list. * * @param points * The points to build a polygon from. * @return The Polygon object. */ public Polygon createPolygon(Point[] points) { Polygon result; result = new Polygon(new LinearRing[] {new LinearRing(points)}); result.srid = 4326; return result; } }
/** * Creates a PostGIS Polygon object corresponding to the provided Point * list. * * @param points * The points to build a polygon from. * @return The Polygon object. */ public Polygon createPolygon(Point[] points) { Polygon result; result = new Polygon(new LinearRing[] {new LinearRing(points)}); result.srid = 4326; return result; } }
result = new MultiPoint(value, haveM); } else if (value.startsWith("POLYGON")) { result = new Polygon(value, haveM); } else if (value.startsWith("LINESTRING")) { result = new LineString(value, haveM);
result = new MultiPoint(value, haveM); } else if (value.startsWith("POLYGON")) { result = new Polygon(value, haveM); } else if (value.startsWith("LINESTRING")) { result = new LineString(value, haveM);
private Polygon createWayBbox(double left, double right, double bottom, double top) { Point[] points; LinearRing ring; Polygon bbox; points = new Point[5]; points[0] = new Point(left, bottom); points[1] = new Point(left, top); points[2] = new Point(right, top); points[3] = new Point(right, bottom); points[4] = new Point(left, bottom); ring = new LinearRing(points); bbox = new Polygon(new LinearRing[] {ring}); bbox.srid = 4326; return bbox; }
private Polygon createWayBbox(double left, double right, double bottom, double top) { Point[] points; LinearRing ring; Polygon bbox; points = new Point[5]; points[0] = new Point(left, bottom); points[1] = new Point(left, top); points[2] = new Point(right, top); points[3] = new Point(right, bottom); points[4] = new Point(left, bottom); ring = new LinearRing(points); bbox = new Polygon(new LinearRing[] {ring}); bbox.srid = 4326; return bbox; }
private static org.postgis.Polygon convert(Polygon polygon) { int numRings = polygon.getNumInteriorRing(); org.postgis.LinearRing[] rings = new org.postgis.LinearRing[numRings + 1]; rings[0] = convert(polygon.getExteriorRing()); for (int i = 0; i < numRings; i++) { rings[i + 1] = convert(polygon.getInteriorRingN(i)); } org.postgis.Polygon pgPolygon = new org.postgis.Polygon(rings); pgPolygon.setSrid(polygon.getSRID()); return pgPolygon; }
private static org.postgis.Polygon convert(Polygon polygon) { int numRings = polygon.getNumInteriorRing(); org.postgis.LinearRing[] rings = new org.postgis.LinearRing[numRings + 1]; rings[0] = convert(polygon.getExteriorRing()); for (int i = 0; i < numRings; i++) { rings[i+1] = convert(polygon.getInteriorRingN(i)); } org.postgis.Polygon pgPolygon = new org.postgis.Polygon(rings); pgPolygon.setSrid(polygon.getSRID()); return pgPolygon; }
private Polygon convertJTSPolygon( com.vividsolutions.jts.geom.Polygon jtsPolygon) { int numRings = jtsPolygon.getNumInteriorRing(); org.postgis.LinearRing[] rings = new org.postgis.LinearRing[numRings + 1]; rings[0] = convertJTSLineStringToLinearRing(jtsPolygon .getExteriorRing()); for (int i = 0; i < numRings; i++) { rings[i + 1] = convertJTSLineStringToLinearRing(jtsPolygon .getInteriorRingN(i)); } Polygon polygon = new org.postgis.Polygon(rings); polygon.setSrid(jtsPolygon.getSRID()); return polygon; }
org.postgis.Polygon pgPoly = new org.postgis.Polygon( linRing ); pgPoly.setSrid( parseSRID( geometry.getCoordinateSystem() ) ); return new PGgeometry( pgPoly );