Class Feature

  • All Implemented Interfaces:
    Serializable

    public class Feature
    extends Object
    implements Serializable
    Feature is a collection of properties and a geometry Feature can contain properties with arbitrary json as the value. These values are returned as JsonElements and their serialization and de-serialization is left to the user. GeoJson reference: @see http://geojson.org/geojson-spec.html#feature-objects. eg: Feature f = Feature.of(polygon).withId(id)
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static Feature of​(Geometry<?> geometry)
        Build a Feature with the given Geometry.
        Parameters:
        geometry - The Geometry to build Feature from
        Returns:
        An instance of Feature
      • geometry

        public Geometry<?> geometry()
        The Geometry of this Feature.
        Returns:
        a Geometry instance.
      • properties

        public Map<String,​com.google.gson.JsonElement> properties()
        The properties of this Feature.
        Returns:
        an Map containing the properties. An empty map if not properties have been set.
      • id

        public Optional<String> id()
        The id of the Feature.
        Returns:
        Optional.absent if this Feature does not have any id. A valued Optional otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object