public class GeoJsonWriter extends Object
Geometry
s as JSON fragments in GeoJson format.Modifier and Type | Field and Description |
---|---|
static String |
EPSG_PREFIX |
Constructor and Description |
---|
GeoJsonWriter()
Constructs a GeoJsonWriter instance.
|
GeoJsonWriter(int decimals)
Constructs a GeoJsonWriter instance specifying the number of decimals to
use when encoding floating point numbers.
|
Modifier and Type | Method and Description |
---|---|
void |
setEncodeCRS(boolean isEncodeCRS) |
String |
write(org.locationtech.jts.geom.Geometry geometry)
Writes a
Geometry in GeoJson format to a String. |
void |
write(org.locationtech.jts.geom.Geometry geometry,
Writer writer)
Writes a
Geometry in GeoJson format into a Writer . |
public static final String EPSG_PREFIX
public GeoJsonWriter()
public GeoJsonWriter(int decimals)
public void setEncodeCRS(boolean isEncodeCRS)
public String write(org.locationtech.jts.geom.Geometry geometry)
Geometry
in GeoJson format to a String.geometry
- public void write(org.locationtech.jts.geom.Geometry geometry, Writer writer) throws IOException
Geometry
in GeoJson format into a Writer
.geometry
- Geometry to encodewriter
- Stream to encode to.IOException
- throws an IOException when unable to write the JSON stringCopyright © 2019. All rights reserved.