/** * Writes a Point as GeoJSON. * * @param point The point. * @param output The output. See {@link GeoJSONUtil#toWriter(Object)} for details. * @throws IOException In the event of a parsing error or if the input json is invalid. */ public void writePoint(Point point, Object output) throws IOException { encode(createPoint(point), output); }
Map<String, Object> create(Geometry geometry) { if (geometry instanceof Point) { return createPoint((Point) geometry); } if (geometry instanceof LineString) { return createLine((LineString) geometry); } if (geometry instanceof Polygon) { return createPolygon((Polygon) geometry); } if (geometry instanceof MultiPoint) { return createMultiPoint((MultiPoint) geometry); } if (geometry instanceof MultiLineString) { return createMultiLine((MultiLineString) geometry); } if (geometry instanceof MultiPolygon) { return createMultiPolygon((MultiPolygon) geometry); } if (geometry instanceof GeometryCollection) { return createGeometryCollection((GeometryCollection) geometry); } throw new IllegalArgumentException("Unable to encode object " + geometry); }
/** * Writes a Point as GeoJSON. * * @param point The point. * @param output The output. See {@link GeoJSONUtil#toWriter(Object)} for details. * * @throws IOException In the event of a parsing error or if the input json is invalid. */ public void writePoint(Point point, Object output) throws IOException { encode(createPoint(point), output); }
Map<String,Object> create(Geometry geometry) { if (geometry instanceof Point) { return createPoint((Point)geometry);