/** * Writes a polygon * * @param geometry The polygon to write * @throws JSONException */ private void writePolygon(Polygon geometry) throws JSONException { this.array(); writeCoordinates(geometry.getExteriorRing().getCoordinateSequence()); for (int i = 0, ii = geometry.getNumInteriorRing(); i < ii; i++) { writeCoordinates(geometry.getInteriorRingN(i).getCoordinateSequence()); } this.endArray(); // end the linear ring // this.endObject(); //end the }
break; case LINESTRING: writeCoordinates(((LineString) geometry).getCoordinateSequence()); break; case MULTIPOINT: writeCoordinates( ((LineString) geometry.getGeometryN(i)).getCoordinateSequence());