Class GeohashReferenceSystem
Object
FormattableObject
AbstractIdentifiedObject
AbstractReferenceSystem
ReferencingByIdentifiers
GeohashReferenceSystem
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,IdentifiedObject
,ReferenceSystem
Geographic coordinates represented as geohashes strings.
Geohash is a simple encoding of geographic coordinates into a short string of letters and digits.
Longer strings are more accurate, however the accuracy is not uniformly distributed between latitude
and longitude, and removing digits decreases accuracy faster when the point is located close to the
equator than close to a pole. For a system having more uniform accuracy, see the
Military Grid Reference System (MGRS).
- Since:
- 0.8
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Conversions between direct positions and geohashes.static enum
The encoding format used byGeohashReferenceSystem.Coder
. -
Field Summary
Fields inherited from class ReferencingByIdentifiers
OVERALL_OWNER_KEY, THEME_KEY
Fields inherited from class AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
Constructor Summary
ConstructorDescriptionCreates a new geohash reference system for the given format and coordinate reference system. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new object performing conversions betweenDirectPosition
and geohashes.Returns the encoding/decoding format.Methods inherited from class ReferencingByIdentifiers
computeHashCode, equals, formatTo, getLocationTypes, getOverallOwner, getTheme
Methods inherited from class AbstractReferenceSystem
getDomainOfValidity, getInterface, getScope
Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getDomains, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class FormattableObject
print, toString, toString, toWKT
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Constructor Details
-
GeohashReferenceSystem
public GeohashReferenceSystem(GeohashReferenceSystem.Format format, GeographicCRS crs) throws GazetteerException Creates a new geohash reference system for the given format and coordinate reference system.- Parameters:
format
- the format used by theGeohashReferenceSystem.Coder
.crs
- the coordinate reference system. This is usuallyCommonCRS.defaultGeographic()
.- Throws:
GazetteerException
- if the reference system cannot be created.
-
-
Method Details
-
getFormat
Returns the encoding/decoding format.- Returns:
- the encoding/decoding format.
-
createCoder
Returns a new object performing conversions betweenDirectPosition
and geohashes. The returned object is not thread-safe; a new instance must be created for each thread, or synchronization must be applied by the caller.- Specified by:
createCoder
in classReferencingByIdentifiers
- Returns:
- a new object performing conversions between
DirectPosition
and geohashes.
-