Package com.massifmaps.geocoding
Class GeocodingResult
java.lang.Object
com.massifmaps.geocoding.GeocodingResult
A geocoding result object describing address, features (geometry) and rank of the result.
-
Constructor Summary
ConstructorsConstructorDescriptionGeocodingResult(Projection projection, GeocodingAddress address, float rank, FeatureCollection featureCollection) Constructs a GeocodingResult from a projection, address, rank and feature collection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks 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.floatgetRank()Returns the rank of the result.
The rank is a normalized number between 0 and 1, 1 meaning a perfect match.inthashCode()Returns the hash value of this object.toString()Creates a string representation of this result object, useful for logging.
-
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
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
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
Returns the feature collection of the result.- Returns:
- The feature collection of the result.
-
getProjection
Returns the projection of the geometry in the result.- Returns:
- The projection of the geometry in the result.
-
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
Creates a string representation of this result object, useful for logging.
-