private void drawGeometry(Graphics2D g2, Geometry geom) { Coordinate[] coords; switch (GeomType.get(geom)) { case POINT: case LINESTRING: drawVertices(g2, geom.getCoordinates()); break; case POLYGON: drawPolygon(g2, (Polygon) geom); break; case MULTIPOINT: case MULTILINESTRING: for (int i = 0; i < geom.getNumGeometries(); i++) { drawVertices(g2, geom.getGeometryN(i).getCoordinates()); } break; case MULTIPOLYGON: for (int i = 0; i < geom.getNumGeometries(); i++) { Polygon px = (Polygon) geom.getGeometryN(i); drawPolygon(g2, px); } break; } }
private void drawGeometry(Graphics2D g2, Geometry geom) { Coordinate[] coords; switch (GeomType.get(geom)) { case POINT: case LINESTRING: drawVertices(g2, geom.getCoordinates()); break; case POLYGON: drawPolygon(g2, (Polygon) geom); break; case MULTIPOINT: case MULTILINESTRING: for (int i = 0; i < geom.getNumGeometries(); i++) { drawVertices(g2, geom.getGeometryN(i).getCoordinates()); } break; case MULTIPOLYGON: for (int i = 0; i < geom.getNumGeometries(); i++) { Polygon px = (Polygon) geom.getGeometryN(i); drawPolygon(g2, px); } break; } }
private void drawPolygon(Graphics2D g2, Polygon poly) { Coordinate[] coords = poly.getExteriorRing().getCoordinates(); drawVertices(g2, coords); for (int i = 0; i < poly.getNumInteriorRing(); i++) { coords = poly.getInteriorRingN(i).getCoordinates(); drawVertices(g2, coords); } }
private void drawPolygon(Graphics2D g2, Polygon poly) { Coordinate[] coords = poly.getExteriorRing().getCoordinates(); drawVertices(g2, coords); for (int i = 0; i < poly.getNumInteriorRing(); i++) { coords = poly.getInteriorRingN(i).getCoordinates(); drawVertices(g2, coords); } }