public class GeoJSONWriter extends Object implements AutoCloseable
| Constructor and Description |
|---|
GeoJSONWriter(OutputStream outputStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getMaxDecimals() |
boolean |
isEncodeFeatureBounds() |
boolean |
isEncodeFeatureCollectionCRS() |
void |
setBounds(ReferencedEnvelope bbox) |
void |
setEncodeFeatureBounds(boolean encodeFeatureCollectionBounds) |
void |
setEncodeFeatureCollectionCRS(boolean b) |
void |
setMaxDecimals(int number)
Set how many decimals should be used in writing out the coordinates.
|
static String |
toGeoJSON(Geometry geometry) |
static String |
toGeoJSON(SimpleFeature f) |
static String |
toGeoJSON(SimpleFeatureCollection fc) |
void |
write(SimpleFeature currentFeature) |
void |
writeFeatureCollection(SimpleFeatureCollection features) |
public GeoJSONWriter(OutputStream outputStream) throws IOException
IOExceptionpublic void write(SimpleFeature currentFeature) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic boolean isEncodeFeatureBounds()
public void setEncodeFeatureBounds(boolean encodeFeatureCollectionBounds)
encodeFeatureCollectionBounds - the encodeFeatureCollectionBounds to setpublic static String toGeoJSON(Geometry geometry)
public static String toGeoJSON(SimpleFeature f)
f - public static String toGeoJSON(SimpleFeatureCollection fc)
fc - public void setEncodeFeatureCollectionCRS(boolean b)
b - public boolean isEncodeFeatureCollectionCRS()
public int getMaxDecimals()
public void setMaxDecimals(int number)
number - - the number of digits after the decimal place markerpublic void writeFeatureCollection(SimpleFeatureCollection features) throws IOException
features - IOExceptionpublic void setBounds(ReferencedEnvelope bbox)
Copyright © 1996–2021 Geotools. All rights reserved.