Package org.vast.ogc.gml
Class GeoJsonBindings
java.lang.Object
org.vast.ogc.gml.GeoJsonBindings
GeoJSON bindings using Gson JsonWriter/JsonReader.
This class is NOT threadsafe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGeoJsonBindings
(boolean useJTS) GeoJsonBindings
(boolean useJTS, boolean enforceTypeFirst) GeoJsonBindings
(GMLFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.gson.stream.JsonReader
beginObjectWithType
(com.google.gson.stream.JsonReader reader) protected AbstractFeature
createFeatureObject
(String type) protected String
decodeFeatureID
(String idVal, AbstractFeature bean) protected String
encodeFeatureID
(IFeature bean) protected org.vast.ogc.gml.GeoJsonBindings.CrsType
getCrsType
(AbstractGeometry bean) protected GeoPoseJsonBindings
protected String
getTypeProp
(IFeature bean) protected boolean
protected boolean
readCommonFeatureProperty
(com.google.gson.stream.JsonReader reader, AbstractFeature f, String name) int
readCoordinates
(com.google.gson.stream.JsonReader reader, gnu.trove.list.array.TDoubleArrayList coords, int prevNumDims) void
readCoordinates
(com.google.gson.stream.JsonReader reader, LineString geom) void
readCoordinates
(com.google.gson.stream.JsonReader reader, Point geom) void
readCoordinates
(com.google.gson.stream.JsonReader reader, Polygon geom) protected void
readCustomFeatureProperty
(com.google.gson.stream.JsonReader reader, GenericFeatureImpl f, String name) protected void
readCustomObjectProperty
(com.google.gson.stream.JsonReader reader, GenericFeatureImpl f, String name) void
readCustomProperties
(com.google.gson.stream.JsonReader reader, Map<QName, Object> map) readEnvelope
(com.google.gson.stream.JsonReader reader) readFeature
(com.google.gson.stream.JsonReader reader) readGeometry
(com.google.gson.stream.JsonReader reader) readGeometry
(com.google.gson.stream.JsonReader reader, String type) int
readLinearRing
(com.google.gson.stream.JsonReader reader, Polygon geom, boolean interior, int prevNumDims) protected boolean
readStandardGeoJsonProperty
(com.google.gson.stream.JsonReader reader, AbstractFeature f, String name) protected String
readTimeBound
(com.google.gson.stream.JsonReader reader, boolean isBegin) readTimeExtent
(com.google.gson.stream.JsonReader reader) protected void
writeCommonFeatureProperties
(com.google.gson.stream.JsonWriter writer, IFeature bean) org.vast.ogc.gml.GeoJsonBindings.CrsType
writeCommonGeometryProperties
(com.google.gson.stream.JsonWriter writer, AbstractGeometry bean) void
writeCoordinates
(com.google.gson.stream.JsonWriter writer, double[] coords, int index, int dims, org.vast.ogc.gml.GeoJsonBindings.CrsType crsType) protected void
writeCustomFeatureProperties
(com.google.gson.stream.JsonWriter writer, IFeature bean) protected void
writeCustomJsonProperties
(com.google.gson.stream.JsonWriter writer, IFeature bean) protected void
writeDateTimeValue
(com.google.gson.stream.JsonWriter writer, Instant dateTime) void
writeEnvelope
(com.google.gson.stream.JsonWriter writer, Envelope bean) void
writeFeature
(com.google.gson.stream.JsonWriter writer, IFeature bean) void
writeGeometry
(com.google.gson.stream.JsonWriter writer, AbstractGeometry bean) protected boolean
writeInline
(com.google.gson.stream.JsonWriter writer, boolean inline) void
writeLinearRing
(com.google.gson.stream.JsonWriter writer, LinearRing bean, int dims, org.vast.ogc.gml.GeoJsonBindings.CrsType crsType) void
writeLineString
(com.google.gson.stream.JsonWriter writer, LineString bean) void
writeLink
(com.google.gson.stream.JsonWriter writer, IXlinkReference<?> link) void
writePoint
(com.google.gson.stream.JsonWriter writer, Point bean) void
writePolygon
(com.google.gson.stream.JsonWriter writer, Polygon bean) protected void
writeStandardGeoJsonProperties
(com.google.gson.stream.JsonWriter writer, IFeature bean) void
writeTimeExtent
(com.google.gson.stream.JsonWriter writer, TimeExtent bean)
-
Field Details
-
MIME_TYPE
- See Also:
-
NAN
- See Also:
-
PLUS_INFINITY
- See Also:
-
MINUS_INFINITY
- See Also:
-
ERROR_UNSUPPORTED_TYPE
- See Also:
-
ERROR_INVALID_COORDINATES
- See Also:
-
ERROR_INVALID_TIMERANGE
- See Also:
-
-
Constructor Details
-
GeoJsonBindings
public GeoJsonBindings() -
GeoJsonBindings
public GeoJsonBindings(boolean useJTS) -
GeoJsonBindings
public GeoJsonBindings(boolean useJTS, boolean enforceTypeFirst) -
GeoJsonBindings
-
-
Method Details
-
writeFeature
public void writeFeature(com.google.gson.stream.JsonWriter writer, IFeature bean) throws IOException - Throws:
IOException
-
writeStandardGeoJsonProperties
protected void writeStandardGeoJsonProperties(com.google.gson.stream.JsonWriter writer, IFeature bean) throws IOException - Throws:
IOException
-
writeCommonFeatureProperties
protected void writeCommonFeatureProperties(com.google.gson.stream.JsonWriter writer, IFeature bean) throws IOException - Throws:
IOException
-
getTypeProp
-
writeCustomFeatureProperties
protected void writeCustomFeatureProperties(com.google.gson.stream.JsonWriter writer, IFeature bean) throws IOException - Throws:
IOException
-
getGeoPoseBindings
-
writeCustomJsonProperties
protected void writeCustomJsonProperties(com.google.gson.stream.JsonWriter writer, IFeature bean) throws IOException - Throws:
IOException
-
hasNonGeoJsonProperties
-
encodeFeatureID
- Throws:
IOException
-
writeLink
public void writeLink(com.google.gson.stream.JsonWriter writer, IXlinkReference<?> link) throws IOException - Throws:
IOException
-
writeEnvelope
public void writeEnvelope(com.google.gson.stream.JsonWriter writer, Envelope bean) throws IOException - Throws:
IOException
-
writeGeometry
public void writeGeometry(com.google.gson.stream.JsonWriter writer, AbstractGeometry bean) throws IOException - Throws:
IOException
-
getCrsType
-
writeCommonGeometryProperties
public org.vast.ogc.gml.GeoJsonBindings.CrsType writeCommonGeometryProperties(com.google.gson.stream.JsonWriter writer, AbstractGeometry bean) throws IOException - Throws:
IOException
-
writePoint
- Throws:
IOException
-
writeLineString
public void writeLineString(com.google.gson.stream.JsonWriter writer, LineString bean) throws IOException - Throws:
IOException
-
writePolygon
- Throws:
IOException
-
writeLinearRing
public void writeLinearRing(com.google.gson.stream.JsonWriter writer, LinearRing bean, int dims, org.vast.ogc.gml.GeoJsonBindings.CrsType crsType) throws IOException - Throws:
IOException
-
writeCoordinates
public void writeCoordinates(com.google.gson.stream.JsonWriter writer, double[] coords, int index, int dims, org.vast.ogc.gml.GeoJsonBindings.CrsType crsType) throws IOException - Throws:
IOException
-
writeTimeExtent
public void writeTimeExtent(com.google.gson.stream.JsonWriter writer, TimeExtent bean) throws IOException - Throws:
IOException
-
writeDateTimeValue
protected void writeDateTimeValue(com.google.gson.stream.JsonWriter writer, Instant dateTime) throws IOException - Throws:
IOException
-
writeInline
protected boolean writeInline(com.google.gson.stream.JsonWriter writer, boolean inline) -
readFeature
- Throws:
IOException
-
createFeatureObject
-
beginObjectWithType
protected com.google.gson.stream.JsonReader beginObjectWithType(com.google.gson.stream.JsonReader reader) throws IOException - Throws:
IOException
-
readStandardGeoJsonProperty
protected boolean readStandardGeoJsonProperty(com.google.gson.stream.JsonReader reader, AbstractFeature f, String name) throws IOException - Throws:
IOException
-
readCommonFeatureProperty
protected boolean readCommonFeatureProperty(com.google.gson.stream.JsonReader reader, AbstractFeature f, String name) throws IOException - Throws:
IOException
-
readCustomFeatureProperty
protected void readCustomFeatureProperty(com.google.gson.stream.JsonReader reader, GenericFeatureImpl f, String name) throws IOException - Throws:
IOException
-
readCustomObjectProperty
protected void readCustomObjectProperty(com.google.gson.stream.JsonReader reader, GenericFeatureImpl f, String name) throws IOException - Throws:
IOException
-
decodeFeatureID
- Throws:
IOException
-
readCustomProperties
public void readCustomProperties(com.google.gson.stream.JsonReader reader, Map<QName, Object> map) throws IOException- Throws:
IOException
-
readEnvelope
- Throws:
IOException
-
readGeometry
- Throws:
IOException
-
readGeometry
public AbstractGeometry readGeometry(com.google.gson.stream.JsonReader reader, String type) throws IOException - Throws:
IOException
-
readCoordinates
public void readCoordinates(com.google.gson.stream.JsonReader reader, Point geom) throws IOException - Throws:
IOException
-
readCoordinates
public void readCoordinates(com.google.gson.stream.JsonReader reader, LineString geom) throws IOException - Throws:
IOException
-
readCoordinates
public void readCoordinates(com.google.gson.stream.JsonReader reader, Polygon geom) throws IOException - Throws:
IOException
-
readLinearRing
public int readLinearRing(com.google.gson.stream.JsonReader reader, Polygon geom, boolean interior, int prevNumDims) throws IOException - Throws:
IOException
-
readCoordinates
public int readCoordinates(com.google.gson.stream.JsonReader reader, gnu.trove.list.array.TDoubleArrayList coords, int prevNumDims) throws IOException - Throws:
IOException
-
readTimeExtent
- Throws:
IOException
-
readTimeBound
protected String readTimeBound(com.google.gson.stream.JsonReader reader, boolean isBegin) throws IOException - Throws:
IOException
-