Class GeohashReferenceSystem
Object
FormattableObject
AbstractIdentifiedObject
AbstractReferenceSystem
ReferencingByIdentifiers
GeohashReferenceSystem
- All Implemented Interfaces:
Serializable, Formattable, Deprecable, LenientComparable, Printable, 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
Nested ClassesModifier and TypeClassDescriptionclassConversions between direct positions and geohashes.static enumThe encoding format used byGeohashReferenceSystem.Coder. -
Field Summary
Fields inherited from class ReferencingByIdentifiers
OVERALL_OWNER_KEY, THEME_KEYFields inherited from class AbstractIdentifiedObject
DEPRECATED_KEY, DOMAINS_KEY, LOCALE_KEYModifier and TypeFieldDescriptionstatic final StringOptional key which can be given to the constructor for specifying the object is deprecated.static final StringKey for the"domains"property to be given to theObjectFactory.createFoo(Map, ...)methods.static final StringOptional key which can be given to the constructor for specifying the locale to use for producing error messages.Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEYFields inherited from interface ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new geohash reference system for the given format and coordinate reference system. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new object performing conversions betweenDirectPositionand geohashes.Returns the encoding/decoding format.Methods inherited from class ReferencingByIdentifiers
equals, formatTo, getLocationTypes, getOverallOwner, getThemeModifier and TypeMethodDescriptionbooleanequals(Object object, ComparisonMode mode) Compares this reference system with the specified object for equality.protected StringFormats a pseudo-Well Known Text (WKT) representation for this object.List<? extends ModifiableLocationType> Description of location type(s) in the spatial reference system.Authority with overall responsibility for the spatial reference system.Property used to characterize the spatial reference system.Methods inherited from class AbstractReferenceSystem
getDomainOfValidity, getScope, getStandardTypeModifier and TypeMethodDescriptionDeprecated.Deprecated.Replaced byAbstractIdentifiedObject.getDomains()as of ISO 19111:2019.Returns the GeoAPI interface that defines the contract of this implementation class.Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getDomains, getIdentifiers, getInterface, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameModifier and TypeMethodDescriptionstatic AbstractIdentifiedObjectcastOrCopy(IdentifiedObject object) Returns a SIS identified object implementation with the values of the given arbitrary implementation.final booleanCompares the specified object with this object for equality.voidFormats the name or identifier of this object using the provider formatter.Returns alternative names by which this object is identified.Returns a narrative explanation of the role of this object.Returns the usage of this CRS-related object.Returns identifiers which references elsewhere the object's defining information.final Class<? extends IdentifiedObject> Deprecated, for removal: This API element is subject to removal in a future version.RenamedAbstractIdentifiedObject.getStandardType()for integration withLenientComparable.getName()Returns the primary name by which this object is identified.Returns comments on or information about this object, including data source information.final intReturns a hash value for this identified object.booleanReturnstrueif this object is deprecated.booleanReturnstrueif either the primary name or at least one alias matches the given string according heuristic rules.Methods inherited from class FormattableObject
print, toString, toString, toWKTModifier and TypeMethodDescriptionvoidprint()Prints a string representation of this object to the standard output stream.Returns a Well Known Text (WKT) or an alternative text representation for this object.toString(Convention convention) Returns a Well Known Text (WKT) for this object using the specified convention.toWKT()Returns a strictly compliant Well Known Text (WKT) using the default convention, symbols and indentation.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface IdentifiedObject
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 betweenDirectPositionand 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:
createCoderin classReferencingByIdentifiers- Returns:
- a new object performing conversions between
DirectPositionand geohashes.
-
AbstractIdentifiedObject.getDomains()as of ISO 19111:2019.