Package org.h2.util.geometry
Class GeoJsonUtils
java.lang.Object
org.h2.util.geometry.GeoJsonUtils
GeoJson format support for GEOMETRY data type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConverter output target that writes a GeoJson. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]ewkbToGeoJson(byte[] ewkb, int dimensionSystem) Converts EWKB with known dimension system to GeoJson.static byte[]geoJsonToEwkb(byte[] json, int srid) Converts EWKB with known dimension system to GeoJson.private static voidparse(JSONObject o, GeometryUtils.Target target, int type) private static voidparse(JSONValue v, GeometryUtils.Target target) private static voidparseCoordinate(JSONValue v, GeometryUtils.Target target, int index, int total) private static voidprivate static voidparseLineString(JSONArray a, GeometryUtils.Target target) private static voidparsePolygon(JSONArray a, GeometryUtils.Target target) private static voidparseRing(JSONValue[] points, GeometryUtils.Target target) private static doublereadCoordinate(JSONValue[] values, int index)
-
Field Details
-
TYPES
0-based type names of geometries, subtract 1 from type code to get index in this array.
-
-
Constructor Details
-
GeoJsonUtils
private GeoJsonUtils()
-
-
Method Details
-
ewkbToGeoJson
public static byte[] ewkbToGeoJson(byte[] ewkb, int dimensionSystem) Converts EWKB with known dimension system to GeoJson.- Parameters:
ewkb- geometry object in EWKB formatdimensionSystem- dimension system of the specified object, may be the same or smaller than its real dimension system. M dimension system is not supported.- Returns:
- GeoJson representation of the specified geometry
- Throws:
DbException- on unsupported dimension system
-
geoJsonToEwkb
public static byte[] geoJsonToEwkb(byte[] json, int srid) Converts EWKB with known dimension system to GeoJson.- Parameters:
json- geometry object in GeoJson formatsrid- the SRID of geometry- Returns:
- GeoJson representation of the specified geometry
- Throws:
DbException- on unsupported dimension system
-
parse
-
parse
-
parseGeometryCollection
-
parseLineString
-
parsePolygon
-
parseRing
-
parseCoordinate
-
readCoordinate
-