Package com.massifmaps.geometry
Class GeoJSONGeometryReader
java.lang.Object
com.massifmaps.geometry.GeoJSONGeometryReader
A GeoJSON parser.
Parser supports Geometry, Feature and FeatureCollection inputs.
Parser supports Geometry, Feature and FeatureCollection inputs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current target projection.readFeature(String geoJSON) Reads feature from the specified GeoJSON string.readFeatureCollection(String geoJSON) Reads feature collection from the specified GeoJSON string.readGeometry(String geoJSON) Reads geometry from the specified GeoJSON string.voidSets the current target projection.
-
Constructor Details
-
GeoJSONGeometryReader
public GeoJSONGeometryReader()Constructs a new GeoJSONGeometryReader object.
-
-
Method Details
-
getTargetProjection
Returns the current target projection. If target projection is set, all geometry
coordinates will be converted from WGS84 to target projection coordinate system.- Returns:
- The current target projection or null.
-
setTargetProjection
Sets the current target projection. If target projection is set, all geometry
coordinates will be converted from WGS84 to target projection coordinate system.- Parameters:
proj- The new target projection or null.
-
readGeometry
Reads geometry from the specified GeoJSON string.- Parameters:
geoJSON- The GeoJSON string to read.- Returns:
- The geometry read from the string.
- Throws:
Exception- If string could not be parsed.
-
readFeature
Reads feature from the specified GeoJSON string.- Parameters:
geoJSON- The GeoJSON string to read.- Returns:
- The feature read from the string.
- Throws:
Exception- If string could not be parsed.
-
readFeatureCollection
Reads feature collection from the specified GeoJSON string.- Parameters:
geoJSON- The GeoJSON string to read.- Returns:
- The feature collection read from the string.
- Throws:
Exception- If string could not be parsed.
-