Class GeoJsonFeature<G extends org.locationtech.jts.geom.Geometry,P>

java.lang.Object
org.bremersee.geojson.model.UnknownAware
org.bremersee.geojson.GeoJsonFeature<G,P>
Type Parameters:
G - the geometry type parameter
P - the properties type parameter

public class GeoJsonFeature<G extends org.locationtech.jts.geom.Geometry,P> extends UnknownAware
A GeoJSON object with the type Feature (see rfc7946 section 3.2).
Author:
Christian Bremer
  • Constructor Details

    • GeoJsonFeature

      public GeoJsonFeature(String id, double[] bbox, G geometry, P properties)
      Instantiates a new geo json feature.
      Parameters:
      id - the id
      bbox - the bbox
      geometry - the geometry
      properties - the properties
    • GeoJsonFeature

      public GeoJsonFeature(String id, G geometry, boolean calculateBounds, P properties)
      Instantiates a new geo json feature.
      Parameters:
      id - an optional id
      geometry - the geometry of the GeoJson feature
      calculateBounds - if true the bounding box will be calculated otherwise the bounding box will be null
      properties - a map with named objects that are associated with the GeoJSON feature
  • Method Details

    • getType

      public final String getType()
      Gets type.
      Returns:
      the type
    • getId

      public String getId()
      Return the id of this GeoJSON feature or null if there is no id available.
      Returns:
      the id of this GeoJSON feature
    • getBbox

      public double[] getBbox()
      Return the bounding box of the GeoJSON object or null if there is no such object (see Bounding Box).
      Returns:
      the bounding box
    • getGeometry

      public G getGeometry()
      Return the geometry object of this GeoJSON feature.
      Returns:
      the geometry
    • getProperties

      public P getProperties()
      Gets properties.
      Returns:
      the properties
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object