Class FlexibleFeature

All Implemented Interfaces:
Feature, Serializable, Cloneable, Comparable

public class FlexibleFeature extends BasicFeature
a FlexibleFeature based on BasicFeature originally used by the GeoJSON reader. currently adding this functionality - "autoextends" by returning null for undefined attribs - lazy conversion of attributes (see getAttribute(int)) currently String, Date, Time, Timestamp
See Also:
  • Constructor Details

    • FlexibleFeature

      public FlexibleFeature(FeatureSchema featureSchema)
  • Method Details

    • getAttribute

      public Object getAttribute(int i)
      Description copied from class: BasicFeature
      Returns the specified attribute.
      Specified by:
      getAttribute in interface Feature
      Overrides:
      getAttribute in class BasicFeature
      Parameters:
      i - the index of the attribute to get
      Returns:
      the attribute
    • getAttributes

      public Object[] getAttributes()
      Returns all attributes in an array of Objects. Use getAttribute(i) to convert raw gml strings into typed attributes.
      Specified by:
      getAttributes in interface Feature
      Overrides:
      getAttributes in class BasicFeature
    • setAttribute

      public void setAttribute(int attributeIndex, Object newAttribute)
      setting an attribute, fixing the underlying array in case the schema changed inbetween
      Specified by:
      setAttribute in interface Feature
      Overrides:
      setAttribute in class BasicFeature
      Parameters:
      attributeIndex - the array index at which to put the new attribute
      newAttribute - the new attribute
    • setGeometry

      public void setGeometry(org.locationtech.jts.geom.Geometry geometry)
      setting the geometry by explicitly using the flexible setAttribute() method above
      Specified by:
      setGeometry in interface Feature
      Overrides:
      setGeometry in class AbstractBasicFeature
      Parameters:
      geometry - the new spatial attribute
    • getGeometry

      public org.locationtech.jts.geom.Geometry getGeometry()
      getting the geometry by explicitly using the flexible getAttribute() method above
      Specified by:
      getGeometry in interface Feature
      Overrides:
      getGeometry in class AbstractBasicFeature
      Returns:
      the feature's spatial attribute