Record Class Feature

java.lang.Object
java.lang.Record
com.eco.bio7.gdal.Feature

public record Feature(long fid, Map<String,Object> attributes, String wkt) extends Record
A feature of a vector layer: its id, attributes (Long, Double or String values, null if not set) and geometry (WKT, null without geometry).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Feature(long fid, Map<String,Object> attributes, String wkt)
    Creates an instance of a Feature record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the attributes record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    fid()
    Returns the value of the fid record component.
    The geometry as GeoJSON (2D), null without geometry.
    The geometry with its coordinates (parsed WKT), null without geometry.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    wkt()
    Returns the value of the wkt record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Feature

      public Feature(long fid, Map<String,Object> attributes, String wkt)
      Creates an instance of a Feature record class.
      Parameters:
      fid - the value for the fid record component
      attributes - the value for the attributes record component
      wkt - the value for the wkt record component
  • Method Details

    • geometry

      public Geometry geometry()
      The geometry with its coordinates (parsed WKT), null without geometry.
    • geoJson

      public String geoJson()
      The geometry as GeoJSON (2D), null without geometry. Created when called (not for every feature read).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • fid

      public long fid()
      Returns the value of the fid record component.
      Returns:
      the value of the fid record component
    • attributes

      public Map<String,Object> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • wkt

      public String wkt()
      Returns the value of the wkt record component.
      Returns:
      the value of the wkt record component