Class ReferencingByIdentifiers
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
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.ReferenceSystem
- Direct Known Subclasses:
GeohashReferenceSystem
,MilitaryGridReferenceSystem
Base class of reference systems that describe locations using geographic identifiers instead of coordinates.
Immutability and thread safety
This base class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar conditions. This means that unless otherwise noted in the javadoc,ReferencingByIdentifiers
instances
created using only SIS factories and static constants can be shared by many objects and passed between threads
without synchronization.- Since:
- 0.8
- Version:
- 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Conversions between direct positions and identifiers.private static final class
A sub-element inside the pseudo-WKT. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final List<AbstractLocationType>
Description of location type(s) in the spatial reference system.static final String
Key for the"overallOwner"
property to be given to the object factorycreateFoo(…)
methods.private final AbstractParty
Authority with overall responsibility for the spatial reference system.private static final long
Serial number for inter-operability with different versions.private final org.opengis.util.InternationalString
Property used to characterize the spatial reference system.static final String
Key for the"theme"
property to be given to the object factorycreateFoo(…)
methods.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
ConstructorsConstructorDescriptionReferencingByIdentifiers
(Map<String, ?> properties, ModifiableLocationType... types) Creates a reference system from the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Invoked byhashCode()
for computing the hash code when first needed.abstract ReferencingByIdentifiers.Coder
Returns a new object performing conversions betweenDirectPosition
and identifiers.boolean
equals
(Object object, ComparisonMode mode) Compares this reference system with the specified object for equality.protected String
Formats 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.org.opengis.util.InternationalString
getTheme()
Property used to characterize the spatial reference system.properties
(Object name, String id, AbstractParty party) Convenience method for helping subclasses to build their argument for the constructor.(package private) final AbstractLocationType
rootType()
Returns the first location type.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
-
THEME_KEY
Key for the"theme"
property to be given to the object factorycreateFoo(…)
methods. This is used for setting the value to be returned bygetTheme()
.- See Also:
-
OVERALL_OWNER_KEY
Key for the"overallOwner"
property to be given to the object factorycreateFoo(…)
methods. This is used for setting the value to be returned bygetOverallOwner()
.- See Also:
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
theme
private final org.opengis.util.InternationalString themeProperty used to characterize the spatial reference system.- See Also:
-
overallOwner
Authority with overall responsibility for the spatial reference system.- See Also:
-
locationTypes
Description of location type(s) in the spatial reference system. This collection shall be unmodifiable.- See Also:
-
-
Constructor Details
-
ReferencingByIdentifiers
Creates a reference system from the given properties. The properties given in argument follow the same rules than for the super-class constructor. The following table is a reminder of main (not all) properties:Recognized properties (non exhaustive list) Property name Value type Returned by "theme" String
orInternationalString
getTheme()
"overallOwner" Party
getOverallOwner()
Defined in parent class (reminder) "name" Identifier
orString
AbstractIdentifiedObject.getName()
"alias" GenericName
orCharSequence
(optionally as array)AbstractIdentifiedObject.getAlias()
"identifiers" Identifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
"remarks" InternationalString
orString
AbstractIdentifiedObject.getRemarks()
"domainOfValidity" Extent
AbstractReferenceSystem.getDomainOfValidity()
"scope" InternationalString
orString
AbstractReferenceSystem.getScope()
LocationType
instances as perModifiableLocationType.snapshot(ReferenceSystemUsingIdentifiers, LocationType...)
. Changes in the given location types after construction will not affect thisReferencingByIdentifiers
.Upcoming API change — generalization
In a future SIS version, the type of array elements may be generalized to theorg.opengis.referencing.gazetteer.LocationType
interface. This change is pending GeoAPI revision.- Parameters:
properties
- the properties to be given to the reference system.types
- description of location type(s) in the spatial reference system.
-
-
Method Details
-
properties
Convenience method for helping subclasses to build their argument for the constructor. The returned properties have the domain of validity set to the whole word and the theme to "mapping".- Parameters:
name
- the reference system name as anIdentifier
or aString
.id
- an identifier for the reference system. Use SIS namespace until we find an authority for them.party
- the overall owner, ornull
if none.
-
getTheme
public org.opengis.util.InternationalString getTheme()Property used to characterize the spatial reference system.- Returns:
- property used to characterize the spatial reference system.
- See Also:
-
getOverallOwner
Authority with overall responsibility for the spatial reference system.Upcoming API change — generalization
in a future SIS version, the type of returned element may be generalized to theorg.opengis.metadata.citation.Party
interface. This change is pending GeoAPI revision for upgrade from ISO 19115:2003 to ISO 19115:2014.- Returns:
- authority with overall responsibility for the spatial reference system.
- See Also:
-
getLocationTypes
Description of location type(s) in the spatial reference system. The collection returned by this method is unmodifiable.Upcoming API change — generalization
in a future SIS version, the type of elements type may be generalized to theorg.opengis.referencing.gazetteer.Location
interface. This change is pending GeoAPI revision.- Returns:
- description of location type(s) in the spatial reference system.
- See Also:
-
rootType
Returns the first location type. -
createCoder
Returns a new object performing conversions betweenDirectPosition
and identifiers. The returned object is not thread-safe; a new instance must be created for each thread, or synchronization must be applied by the caller.- Returns:
- a new object performing conversions between
DirectPosition
and identifiers. - Since:
- 1.3
-
equals
Compares this reference system with the specified object for equality. If themode
argument value isSTRICT
orBY_CONTRACT
, then all available properties are compared including the theme and the overall owner.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractReferenceSystem
- Parameters:
object
- the object to compare tothis
.mode
-STRICT
for performing a strict comparison, orIGNORE_METADATA
for comparing only properties relevant to location identifications.- Returns:
true
if both objects are equal.- See Also:
-
computeHashCode
protected long computeHashCode()Invoked byhashCode()
for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()
for more information.- Overrides:
computeHashCode
in classAbstractReferenceSystem
- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
formatTo
Formats a pseudo-Well Known Text (WKT) representation for this object. The format produced by this method is non-standard and may change in any future Apache SIS version.- Overrides:
formatTo
in classAbstractIdentifiedObject
- Parameters:
formatter
- the formatter where to format the inner content of this pseudo-WKT element.- Returns:
- an arbitrary keyword for the pseudo-WKT element.
- See Also:
-