Class GeohashReferenceSystem
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.AbstractReferenceSystem
org.apache.sis.referencing.gazetteer.ReferencingByIdentifiers
org.apache.sis.referencing.gazetteer.GeohashReferenceSystem
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.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
- Version:
- 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Conversions between direct positions and geohashes.private final class
The result of decoding a geohash.static enum
The encoding format used byGeohashReferenceSystem.Coder
. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final org.opengis.referencing.operation.CoordinateOperation
The coordinate operation fromnormalizedCRS
to the CRS specified by the user.(package private) final GeohashReferenceSystem.Format
The format used by theGeohashReferenceSystem.Coder
.(package private) static final String
Identifier for this reference system.private static GeohashReferenceSystem
The unique instance, created when first requested.(package private) final DefaultGeographicCRS
The user supplied CRS with (longitude, latitude) axis order in degrees.private static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.referencing.gazetteer.ReferencingByIdentifiers
locationTypes, OVERALL_OWNER_KEY, THEME_KEY
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionGeohashReferenceSystem
(GeohashReferenceSystem.Format format, org.opengis.referencing.crs.GeographicCRS crs) Creates 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.(package private) static GeohashReferenceSystem
Returns the unique instance.private static ModifiableLocationType[]
types()
Work around for RFE #4093999 in Sun's bug database ("Relax constraint on placement of this()/super() call in constructors").Methods inherited from class org.apache.sis.referencing.gazetteer.ReferencingByIdentifiers
computeHashCode, equals, formatTo, getLocationTypes, getOverallOwner, getTheme, properties, rootType
Methods inherited from class org.apache.sis.referencing.AbstractReferenceSystem
getDomainOfValidity, getInterface, getScope
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
IDENTIFIER
Identifier for this reference system.- See Also:
-
format
The format used by theGeohashReferenceSystem.Coder
. -
normalizedCRS
The user supplied CRS with (longitude, latitude) axis order in degrees. -
denormalize
final org.opengis.referencing.operation.CoordinateOperation denormalizeThe coordinate operation fromnormalizedCRS
to the CRS specified by the user. The target CRS is the coordinate reference system to assign to the decoded positions. -
INSTANCE
The unique instance, created when first requested.
-
-
Constructor Details
-
GeohashReferenceSystem
public GeohashReferenceSystem(GeohashReferenceSystem.Format format, org.opengis.referencing.crs.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
-
getInstance
Returns the unique instance.- Throws:
GazetteerException
-
types
Work around for RFE #4093999 in Sun's bug database ("Relax constraint on placement of this()/super() call in constructors"). -
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.
-