Class BasicFeature

  • All Implemented Interfaces:
    io.jeo.vector.Feature

    public class BasicFeature
    extends java.lang.Object
    implements io.jeo.vector.Feature
    Basic feature implementation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  BasicFeature.Storage  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String id
      feature identifier
      protected BasicFeature.Storage storage
      Underlying feature storage.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        BasicFeature​(java.lang.String id)
      Constructor taking a feature identifier.
        BasicFeature​(java.lang.String id, io.jeo.vector.Schema schema)
      Constructor taking a feature identifier and an explicit schema object.
        BasicFeature​(java.lang.String id, java.util.List<java.lang.Object> values)
      Constructs a feature from an identifier and a list of values.
        BasicFeature​(java.lang.String id, java.util.List<java.lang.Object> values, io.jeo.vector.Schema schema)
      Constructs a feature from an identifier, a list of values, and a schema.
        BasicFeature​(java.lang.String id, java.util.Map<java.lang.String,​java.lang.Object> values)
      Constructs a feature from an identifier and a map of values.
        BasicFeature​(java.lang.String id, java.util.Map<java.lang.String,​java.lang.Object> values, io.jeo.vector.Schema schema)
      Constructs a feature from an identifier, a map of values, and a schema.
      protected BasicFeature​(java.lang.String id, BasicFeature.Storage storage)
      Constructor taking an identifier and feature storage object directly.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BasicFeature crs​(org.osgeo.proj4j.CoordinateReferenceSystem crs)  
      boolean equals​(java.lang.Object obj)  
      com.vividsolutions.jts.geom.Geometry geometry()  
      java.lang.Object get​(java.lang.String key)  
      boolean has​(java.lang.String key)  
      int hashCode()  
      java.lang.String id()  
      java.util.Map<java.lang.String,​java.lang.Object> map()  
      BasicFeature put​(com.vividsolutions.jts.geom.Geometry g)  
      BasicFeature put​(java.lang.String key, java.lang.Object val)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • id

        protected java.lang.String id
        feature identifier
    • Constructor Detail

      • BasicFeature

        public BasicFeature​(java.lang.String id)
        Constructor taking a feature identifier.
        Parameters:
        id - The feature id, if null an identifier will be generated.
      • BasicFeature

        public BasicFeature​(java.lang.String id,
                            io.jeo.vector.Schema schema)
        Constructor taking a feature identifier and an explicit schema object.
        Parameters:
        id - The feature id, if null an identifier will be generated.
        schema - The feature schema, if null the schema will be always be derived
      • BasicFeature

        public BasicFeature​(java.lang.String id,
                            java.util.List<java.lang.Object> values)
        Constructs a feature from an identifier and a list of values.
        Parameters:
        id - The feature id, if null an identifier will be generated.
        values - The feature values.
      • BasicFeature

        public BasicFeature​(java.lang.String id,
                            java.util.List<java.lang.Object> values,
                            io.jeo.vector.Schema schema)
        Constructs a feature from an identifier, a list of values, and a schema.
        Parameters:
        id - The feature id, if null an identifier will be generated.
        values - The feature values.
        schema - The feature schema, if null the schema will be always be derived
      • BasicFeature

        public BasicFeature​(java.lang.String id,
                            java.util.Map<java.lang.String,​java.lang.Object> values)
        Constructs a feature from an identifier and a map of values.
        Parameters:
        id - The feature id, if null an identifier will be generated.
        values - The feature values.
      • BasicFeature

        public BasicFeature​(java.lang.String id,
                            java.util.Map<java.lang.String,​java.lang.Object> values,
                            io.jeo.vector.Schema schema)
        Constructs a feature from an identifier, a map of values, and a schema.
        Parameters:
        id - The feature id, if null an identifier will be generated.
        values - The feature values.
        schema - The feature schema, if null the schema will be always be derived
      • BasicFeature

        protected BasicFeature​(java.lang.String id,
                               BasicFeature.Storage storage)
        Constructor taking an identifier and feature storage object directly.

        This constructor is typically only used for subclasses that need to implement custom feature storage.

    • Method Detail

      • id

        public java.lang.String id()
        Specified by:
        id in interface io.jeo.vector.Feature
      • crs

        public BasicFeature crs​(org.osgeo.proj4j.CoordinateReferenceSystem crs)
      • has

        public boolean has​(java.lang.String key)
        Specified by:
        has in interface io.jeo.vector.Feature
      • get

        public java.lang.Object get​(java.lang.String key)
        Specified by:
        get in interface io.jeo.vector.Feature
      • put

        public BasicFeature put​(java.lang.String key,
                                java.lang.Object val)
        Specified by:
        put in interface io.jeo.vector.Feature
      • put

        public BasicFeature put​(com.vividsolutions.jts.geom.Geometry g)
        Specified by:
        put in interface io.jeo.vector.Feature
      • geometry

        public com.vividsolutions.jts.geom.Geometry geometry()
        Specified by:
        geometry in interface io.jeo.vector.Feature
      • map

        public java.util.Map<java.lang.String,​java.lang.Object> map()
        Specified by:
        map in interface io.jeo.vector.Feature
      • toString

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object