Class GeoJsonWriter
java.lang.Object
org.gvsig.fmap.geom.jts.formats.geojson.GeoJsonWriter
- Direct Known Subclasses:
GeoJsonWriterEx
Writes
Geometrys as JSON fragments in GeoJson format.- Author:
- Martin Davis, Paul Howells, Vivid Solutions
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a GeoJsonWriter instance.GeoJsonWriter(int decimals) Constructs a GeoJsonWriter instance specifying the number of decimals to use when encoding floating point numbers. -
Method Summary
Modifier and TypeMethodDescriptioncreate(com.vividsolutions.jts.geom.Geometry geometry, boolean encodeCRS) voidsetEncodeCRS(boolean isEncodeCRS) write(com.vividsolutions.jts.geom.Geometry geometry) Writes aGeometryin GeoJson format to a String.voidWrites aGeometryin GeoJson format into aWriter.
-
Field Details
-
EPSG_PREFIX
- See Also:
-
isEncodeCRS
protected boolean isEncodeCRS
-
-
Constructor Details
-
GeoJsonWriter
public GeoJsonWriter()Constructs a GeoJsonWriter instance. -
GeoJsonWriter
public GeoJsonWriter(int decimals) Constructs a GeoJsonWriter instance specifying the number of decimals to use when encoding floating point numbers.
-
-
Method Details
-
setEncodeCRS
public void setEncodeCRS(boolean isEncodeCRS) -
write
Writes aGeometryin GeoJson format to a String.- Parameters:
geometry-- Returns:
- String GeoJson Encoded Geometry
-
write
Writes aGeometryin GeoJson format into aWriter.- Parameters:
geometry- Geometry to encodewriter- Stream to encode to.- Throws:
IOException- throws an IOException when unable to write the JSON string
-
create
-