Class CompositeGeometry

java.lang.Object
ddf.geo.formatter.CompositeGeometry
Direct Known Subclasses:
Point

public abstract class CompositeGeometry extends Object
Abstract class that represents the geometric portion of GeoJSON.
Author:
Ashraf Barakat
  • Field Details

  • Constructor Details

    • CompositeGeometry

      public CompositeGeometry()
  • Method Details

    • getCompositeGeometry

      public static CompositeGeometry getCompositeGeometry(org.locationtech.jts.geom.Geometry geometry)
      Deciphers the CompositeGeometry object to return based on Geometry
      Parameters:
      geometry -
      Returns:
      CompositeGeometry
    • getCompositeGeometry

      public static CompositeGeometry getCompositeGeometry(String type, Map jsonObject)
      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:
      CompositeGeometry based on the type passed in, returns null if the type is not one of the standard GeoJSON geometric strings.
    • getCoordinate

      protected static org.locationtech.jts.geom.Coordinate getCoordinate(List primitiveCoordinates)
      Parameters:
      primitiveCoordinates - requires x and y coordinate information as a List, x coordinate is the first item in the list
      Returns:
      Coordinate object
    • 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 Coordinate objects, if input is null or empty, it will return an empty array
    • toJsonMap

      public abstract Map toJsonMap() throws UnsupportedOperationException
      Creates a Map that mimics the GeoJSON structure.
      Throws:
      UnsupportedOperationException - when the object cannot write into the map
    • toWkt

      public abstract String toWkt()
      Returns:
      well-known text of underlying equivalent Geometric object
    • toGeoRssPositions

      public abstract List<org.apache.abdera.ext.geo.Position> toGeoRssPositions()
    • getGeometry

      public abstract org.locationtech.jts.geom.Geometry getGeometry()
      Returns:
      equivalent geometric object