java.lang.Object | |
↳ | com.carto.geometry.GeoJSONGeometryWriter |
A GeoJSON writer. Generates human-readable GeoJSON representation of the geometry, feature or feature collection.
Supports both 2D and 3D coordinate serialization.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeoJSONGeometryWriter()
Constructs a new GeoJSONGeometryWriter object with default settings.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
Projection |
getSourceProjection()
Returns the current source projection.
| ||||||||||
boolean |
getZ()
Returns the state of Z coordinate serialization.
| ||||||||||
void |
setSourceProjection(Projection proj)
Sets the current source projection.
| ||||||||||
void |
setZ(boolean z)
Sets the state of Z coordinate serialization.
| ||||||||||
String |
writeFeature(Feature feature)
Creates a GeoJSON string corresponding to the specified feature.
| ||||||||||
String |
writeFeatureCollection(FeatureCollection featureCollection)
Creates a GeoJSON string corresponding to the specified feature collection.
| ||||||||||
String |
writeGeometry(Geometry geometry)
Creates a GeoJSON string corresponding to the specified geometry.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a new GeoJSONGeometryWriter object with default settings.
Returns the current source projection. If source projection is set, all geometry
coordinates will be converted from given coordinate system to WGS84.
Returns the state of Z coordinate serialization.
Sets the current source projection. If source projection is set, all geometry
coordinates will be converted from given coordinate system to WGS84.
proj | The new source projection or null. |
---|
Sets the state of Z coordinate serialization.
z | True when Z coordinate should be serialized, false otherwise. |
---|
Creates a GeoJSON string corresponding to the specified feature.
feature | The feature to write. |
---|
Exception | If string could not be generated. |
---|
Creates a GeoJSON string corresponding to the specified feature collection.
featureCollection | The feature collection to write. |
---|
Exception | If string could not be generated. |
---|
Creates a GeoJSON string corresponding to the specified geometry.
geometry | The geometry to write. |
---|
Exception | If string could not be generated. |
---|