Class CommonAuthorityFactory
Object
AbstractFactory
GeodeticAuthorityFactory
CommonAuthorityFactory
- All Implemented Interfaces:
AuthorityFactory, CRSAuthorityFactory, Factory
Creates coordinate reference systems in the "
OGC", "CRS" or "AUTO(2)" namespaces.
All namespaces recognized by this factory are defined by the Open Geospatial Consortium (OGC).
Most codes map to one of the constants in the CommonCRS enumeration.
| Namespace | Code | Name | Datum type | CS type | Axis direction | Units |
|---|---|---|---|---|---|---|
| CRS | 1 | Computer display | Engineering | Cartesian | (east, south) | pixels |
| CRS | 27 | NAD27 | Geographic | Ellipsoidal | (east, north) | degrees |
| CRS | 83 | NAD83 | Geographic | Ellipsoidal | (east, north) | degrees |
| CRS | 84 | WGS84 | Geographic | Ellipsoidal | (east, north) | degrees |
| CRS | 88 | NAVD88 | Vertical | Vertical | up | metres |
| AUTO2 | 42001 | WGS 84 / Auto UTM | Projected | Cartesian | (east, north) | user-specified |
| AUTO2 | 42002 | WGS 84 / Auto Tr Mercator | Projected | Cartesian | (east, north) | user-specified |
| AUTO2 | 42003 | WGS 84 / Auto Orthographic | Projected | Cartesian | (east, north) | user-specified |
| AUTO2 | 42004 | WGS 84 / Auto Equirectangular | Projected | Cartesian | (east, north) | user-specified |
| AUTO2 | 42005 | WGS 84 / Auto Mollweide | Projected | Cartesian | (east, north) | user-specified |
| OGC | JulianDate | Julian | Temporal | Time | (future) | days |
| OGC | TruncatedJulianDate | Truncated Julian | Temporal | Time | (future) | days |
| OGC | UnixTime | Unix Time | Temporal | Time | (future) | seconds |
Note on codes in CRS namespace
The format is usually "CRS:n" where n is a number like 27, 83 or 84.
However, this factory is lenient and allows the CRS part to be repeated as in "CRS:CRS84".
It also accepts "OGC" as a synonymous of the "CRS" namespace.
Examples:
"CRS:27", "CRS:83", "CRS:84", "CRS:CRS84", "OGC:CRS84".Note on codes in AUTO(2) namespace
The format is usually "AUTO2:n,factor,λ₀,φ₀"
where n is a number between 42001 and 42005 inclusive, factor is a conversion
factor from the CRS units to metres (e.g. 0.3048 for a CRS with axes in feet) and (λ₀,φ₀)
is the longitude and latitude of a point in the projection centre.
Examples:
Codes in the "AUTO2:42001,1,-100,45" identifies a Universal Transverse Mercator (UTM) projection
for a zone containing the point at (45°N, 100°W) with axes in metres."AUTO" namespace are the same as codes in the "AUTO2" namespace, except that
the EPSG code of the desired unit of measurement
was used instead of the unit factor.
The "AUTO" namespace was defined in the Web Map Service (WMS) 1.1.1 specification
while the "AUTO2" namespace is defined in WMS 1.3.0.
In Apache SIS implementation, the unit parameter (either as factor or as EPSG code) is optional and defaults to metres.
In the AUTO(2):42001 case, the UTM zone is calculated as specified in WMS 1.3 specification,
i.e. without taking in account the Norway and Svalbard special cases and without
switching to polar stereographic projections for high latitudes.
- Since:
- 0.7
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a default factory for theCRSauthority. -
Method Summary
Modifier and TypeMethodDescriptionCreates a coordinate reference system from the specified code.createObject(String code) Creates an object from the specified code.Returns the specification that defines the codes recognized by this factory.getAuthorityCodes(Class<? extends IdentifiedObject> type) Provides a complete set of the known codes provided by this factory.Returns the namespaces defined by the OGC specifications implemented by this factory.getDescriptionText(Class<? extends IdentifiedObject> type, String code) Returns a description of the object corresponding to a code.Methods inherited from class GeodeticAuthorityFactory
createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDatumEnsemble, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createParametricCRS, createParametricCS, createParametricDatum, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getDescriptionText, newIdentifiedObjectFinder, toString, trimNamespaceModifier and TypeMethodDescriptioncreateCartesianCS(String code) Creates a 2- or 3-dimensional Cartesian coordinate system made of straight orthogonal axes.createCompoundCRS(String code) Creates a CRS describing the position of points through two or more independent coordinate reference systems.Creates an operation for transforming coordinates in the source CRS to coordinates in the target CRS.Creates an arbitrary coordinate system from a code.Creates a coordinate system axis with name, direction, unit and range of values.createCylindricalCS(String code) Creates a 3-dimensional coordinate system made of a polar coordinate system extended by a straight perpendicular axis.createDatum(String code) Creates an arbitrary datum from a code.createDatumEnsemble(String code) Creates an arbitrary datum ensemble from a code.createDerivedCRS(String code) Creates a CRS that is defined by its coordinate conversion from another CRS (not by a datum).createEllipsoid(String code) Creates a geometric figure that can be used to describe the approximate shape of the earth.createEllipsoidalCS(String code) Creates a 2- or 3-dimensional coordinate system for geodetic latitude and longitude, sometimes with ellipsoidal height.createEngineeringCRS(String code) Creates a 1-, 2- or 3-dimensional contextually local coordinate reference system.Creates a datum defining the origin of an engineering coordinate reference system.createExtent(String code) Creates information about spatial, vertical, and temporal extent (usually a domain of validity) from a code.createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) Creates operations from source and target coordinate reference system codes.createGeocentricCRS(String code) Creates a 3-dimensional coordinate reference system with the origin at the approximate centre of mass of the earth.createGeodeticDatum(String code) Creates a datum defining the location and orientation of an ellipsoid that approximates the shape of the earth.createGeographicCRS(String code) Creates a 2- or 3-dimensional coordinate reference system based on an ellipsoidal approximation of the geoid.createImageCRS(String code) Deprecated.createImageDatum(String code) Deprecated.TheImageDatumclass has been removed in ISO 19111:2019.final <T extends IdentifiedObject>
TcreateObject(Class<T> type, String code) Returns an object of the specified type from a code.Creates a description of the algorithm and parameters used to perform a coordinate operation.Creates a definition of a single parameter used by an operation method.createParametricCRS(String code) Creates a 1-dimensional parametric coordinate reference system.createParametricCS(String code) Creates a 1-dimensional parametric coordinate system.Creates a datum defining the origin of a parametric coordinate reference system.createPolarCS(String code) Creates a 2-dimensional coordinate system for coordinates represented by a distance from the origin and an angle from a fixed direction.createPrimeMeridian(String code) Creates a prime meridian defining the origin from which longitude values are determined.createProjectedCRS(String code) Creates a 2-dimensional coordinate reference system used to approximate the shape of the earth on a planar surface.createSphericalCS(String code) Creates a 3-dimensional coordinate system with one distance measured from the origin and two angular coordinates.createTemporalCRS(String code) Creates a 1-dimensional coordinate reference system used for the recording of time.createTemporalDatum(String code) Creates a datum defining the origin of a temporal coordinate reference system.createTimeCS(String code) Creates a 1-dimensional coordinate system for time elapsed in the specified time units from a specified time origin.Unit<?> createUnit(String code) Creates an unit of measurement from a code.createVerticalCRS(String code) Creates a 1-dimensional coordinate reference system used for recording heights or depths.createVerticalCS(String code) Creates a 1-dimensional coordinate system for heights or depths of points.createVerticalDatum(String code) Creates a datum identifying a particular reference level surface used as a zero-height surface.getDescriptionText(String code) Deprecated.This method is ambiguous because the EPSG geodetic registry may allocate the same code to different kinds of object.Creates a finder which can be used for looking up unidentified objects.Returns a string representation of this factory for debugging purpose only.protected final StringtrimNamespace(String code) Trims the namespace, if present.Methods inherited from class AbstractFactory
getVendorModifier and TypeMethodDescriptionReturns the implementer of this factory, ornullif unknown.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CRSAuthorityFactory
createCompoundCRS, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRSModifier and TypeMethodDescriptioncreateCompoundCRS(String code) Creates a 3D coordinate reference system from a code.createDerivedCRS(String code) Creates a derived coordinate reference system from a code.createEngineeringCRS(String code) Create a engineering coordinate reference system from a code.createGeocentricCRS(String code) Returns a geocentric coordinate reference system from a code.createGeographicCRS(String code) Returns a geographic coordinate reference system from a code.createImageCRS(String code) Create a image coordinate reference system from a code.createProjectedCRS(String code) Returns a projected coordinate reference system from a code.createTemporalCRS(String code) Create a temporal coordinate reference system from a code.createVerticalCRS(String code) Create a vertical coordinate reference system from a code.
-
Constructor Details
-
CommonAuthorityFactory
public CommonAuthorityFactory()Constructs a default factory for theCRSauthority.
-
-
Method Details
-
getAuthority
Returns the specification that defines the codes recognized by this factory. The definitive source for this factory is OGC Web Map Service (WMS) specification, also available as the ISO 19128 Geographic Information — Web map server interface standard.While the authority is WMS, the namespace of that authority is set to
"OGC". Apache SIS does that for consistency with the namespace used in URNs (for example"urn:ogc:def:crs:OGC:1.3:CRS84").- Specified by:
getAuthorityin interfaceAuthorityFactory- Specified by:
getAuthorityin classGeodeticAuthorityFactory- Returns:
- the
Web Map Service
authority. - See Also:
-
getAuthorityCodes
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException Provides a complete set of the known codes provided by this factory. The returned set contains a namespace followed by identifiers like"CRS:84","CRS:27","AUTO2:42001", etc.- Specified by:
getAuthorityCodesin interfaceAuthorityFactory- Parameters:
type- the spatial reference objects type.- Returns:
- the set of authority codes for spatial reference objects of the given type.
- Throws:
FactoryException- if this method failed to provide the set of codes.
-
getCodeSpaces
Returns the namespaces defined by the OGC specifications implemented by this factory. At the difference of other factories, the namespaces ofCommonAuthorityFactoryare quite different than the authority title or identifier:- Authority:
"WMS"(forWeb Map Services
) - Namespaces:
"CRS","AUTO","AUTO2". The"OGC"namespace is also accepted for compatibility reason, but its scope is wider than the above-cited namespaces.
- Overrides:
getCodeSpacesin classGeodeticAuthorityFactory- Returns:
- a set containing at least the
"CRS","AUTO"and"AUTO2"strings. - See Also:
- Authority:
-
getDescriptionText
public Optional<InternationalString> getDescriptionText(Class<? extends IdentifiedObject> type, String code) throws FactoryException Returns a description of the object corresponding to a code. The description can be used for example in a combo box in a graphical user interface.Codes in the
"AUTO(2)"namespace do not need parameters for this method. But if parameters are nevertheless specified, then they will be taken in account.Examples Argument value Return value CRS:84WGS 84 AUTO2:42001WGS 84 / Auto UTM AUTO2:42001,1,-100,45WGS 84 / UTM zone 47N - Overrides:
getDescriptionTextin classGeodeticAuthorityFactory- Parameters:
type- the type of object for which to get a description.code- value in the CRS or AUTO(2) code space.- Returns:
- a description of the object.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if an error occurred while fetching the description.- Since:
- 1.5
-
createObject
Creates an object from the specified code. The default implementation delegates tocreateCoordinateReferenceSystem(String).- Specified by:
createObjectin interfaceAuthorityFactory- Specified by:
createObjectin classGeodeticAuthorityFactory- Parameters:
code- value allocated by authority.- Returns:
- the object for the given code.
- Throws:
FactoryException- if the object creation failed.- See Also:
-
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException Creates a coordinate reference system from the specified code. This method performs the following steps:- Skip the
"OGC","CRS","AUTO","AUTO1"or"AUTO2"namespace if present (ignoring case). All other namespaces will cause an exception to be thrown. - Skip the
"CRS"prefix if present. This additional check is for accepting codes like"OGC:CRS84"(not a valid CRS code, but seen in practice). - In the remaining text, interpret the integer value as documented in this class javadoc. Note that some codes require coma-separated parameters after the integer value.
- Specified by:
createCoordinateReferenceSystemin interfaceCRSAuthorityFactory- Overrides:
createCoordinateReferenceSystemin classGeodeticAuthorityFactory- Parameters:
code- value allocated by OGC.- Returns:
- the coordinate reference system for the given code.
- Throws:
FactoryException- if the object creation failed.- See Also:
- Skip the
-
ImageCRSclass has been removed in ISO 19111:2019.