Class GeocodingResult

java.lang.Object
com.massifmaps.geocoding.GeocodingResult

public class GeocodingResult extends Object
A geocoding result object describing address, features (geometry) and rank of the result.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeocodingResult(Projection projection, GeocodingAddress address, float rank, FeatureCollection featureCollection)
    Constructs a GeocodingResult from a projection, address, rank and feature collection.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    Returns the address of the result.
    Returns the feature collection of the result.
    Returns the result as a GeoJSON FeatureCollection, in WGS84.

    Every feature carries the result's "address" and "rank" alongside its own properties, so
    one string is the whole answer - a binding that walked the features instead paid a
    crossing per feature and rebuilt this shape by hand.
    Returns the projection of the geometry in the result.
    float
    Returns the rank of the result.
    The rank is a normalized number between 0 and 1, 1 meaning a perfect match.
    int
    Returns the hash value of this object.
    Creates a string representation of this result object, useful for logging.

    Methods inherited from class java.lang.Object

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

    • GeocodingResult

      public GeocodingResult(Projection projection, GeocodingAddress address, float rank, FeatureCollection featureCollection)
      Constructs a GeocodingResult from a projection, address, rank and feature collection.
      Parameters:
      projection - The projection used for the geometry of the result.
      address - The address of the result.
      rank - The relative ranking of the result (in range 0..1).
      featureCollection - The geometry (features) associated with the result.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getAddress

      public GeocodingAddress getAddress()
      Returns the address of the result.
      Returns:
      The address of the result.
    • getRank

      public float getRank()
      Returns the rank of the result.
      The rank is a normalized number between 0 and 1, 1 meaning a perfect match.
      Returns:
      The rank of the result.
    • getFeatureCollection

      public FeatureCollection getFeatureCollection()
      Returns the feature collection of the result.
      Returns:
      The feature collection of the result.
    • getProjection

      public Projection getProjection()
      Returns the projection of the geometry in the result.
      Returns:
      The projection of the geometry in the result.
    • getGeoJSON

      public String getGeoJSON()
      Returns the result as a GeoJSON FeatureCollection, in WGS84.

      Every feature carries the result's "address" and "rank" alongside its own properties, so
      one string is the whole answer - a binding that walked the features instead paid a
      crossing per feature and rebuilt this shape by hand.
      Returns:
      The result as GeoJSON.
    • toString

      public String toString()
      Creates a string representation of this result object, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this result object.