Package ddf.geo.formatter
Class CompositeGeometry
java.lang.Object
ddf.geo.formatter.CompositeGeometry
- Direct Known Subclasses:
Point
Abstract class that represents the geometric portion of GeoJSON.
- Author:
- Ashraf Barakat
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompositeGeometrygetCompositeGeometry(String type, Map jsonObject) static CompositeGeometrygetCompositeGeometry(org.locationtech.jts.geom.Geometry geometry) Deciphers theCompositeGeometryobject to return based onGeometryprotected static org.locationtech.jts.geom.CoordinategetCoordinate(List primitiveCoordinates) protected static org.locationtech.jts.geom.Coordinate[]getCoordinates(List<List> primitiveCoordinatesList) abstract org.locationtech.jts.geom.Geometryabstract List<org.apache.abdera.ext.geo.Position>abstract MapCreates a Map that mimics the GeoJSON structure.abstract StringtoWkt()
-
Field Details
-
TYPE_KEY
- See Also:
-
COORDINATES_KEY
- See Also:
-
PROPERTIES_KEY
- See Also:
-
GEOMETRY_KEY
- See Also:
-
GEOMETRIES_KEY
- See Also:
-
GEOMETRY_FACTORY
protected static final org.locationtech.jts.geom.GeometryFactory GEOMETRY_FACTORY
-
-
Constructor Details
-
CompositeGeometry
public CompositeGeometry()
-
-
Method Details
-
getCompositeGeometry
Deciphers theCompositeGeometryobject to return based onGeometry- Parameters:
geometry-- Returns:
CompositeGeometry
-
getCompositeGeometry
- Parameters:
type- case-sensitive String of the geometric type, must match the exact spelling in the GeoJSON standard (geojson.org)jsonObject- Map of coordinates or geometries- Returns:
CompositeGeometrybased on thetypepassed in, returnsnullif the type is not one of the standard GeoJSON geometric strings.
-
getCoordinate
- Parameters:
primitiveCoordinates- requires x and y coordinate information as aList, x coordinate is the first item in the list- Returns:
Coordinateobject
-
getCoordinates
protected static org.locationtech.jts.geom.Coordinate[] getCoordinates(List<List> primitiveCoordinatesList) - Parameters:
primitiveCoordinatesList- a List of [x,y] coordinates. The [x,y] coordinates is a list of two objects where x coordinate is first and the y coordinate is second in the list- Returns:
- an array of
Coordinateobjects, if input isnullor empty, it will return an empty array
-
toJsonMap
Creates a Map that mimics the GeoJSON structure.- Throws:
UnsupportedOperationException- when the object cannot write into the map
-
toWkt
- Returns:
- well-known text of underlying equivalent Geometric object
-
toGeoRssPositions
-
getGeometry
public abstract org.locationtech.jts.geom.Geometry getGeometry()- Returns:
- equivalent geometric object
-