Class ServicesForMetadata
- All Implemented Interfaces:
EventListener
"sis-metadata" module.- Since:
- 0.5
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of anOnLineFunctioncode list value, used for transferring information about the EPSG database.Fields inherited from class org.apache.sis.internal.metadata.ReferencingServices
AUTHALIC_RADIUS, NAUTICAL_MILE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElements(org.opengis.geometry.Envelope envelope, DefaultExtent target) Initializes a horizontal, vertical and temporal extent with the values inferred from the given envelope.createCoordinateFormat(Locale locale, TimeZone timezone) Creates a format forDirectPositioninstances.static org.opengis.referencing.crs.SingleCRScreateParametricCRS(Map<String, ?> properties, org.opengis.referencing.datum.Datum datum, org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.crs.CRSFactory factory) Creates a parametric CRS.static org.opengis.referencing.cs.CoordinateSystemcreateParametricCS(Map<String, ?> properties, org.opengis.referencing.cs.CoordinateSystemAxis axis, org.opengis.referencing.cs.CSFactory factory) Creates a parametric CS.static org.opengis.referencing.datum.DatumcreateParametricDatum(Map<String, ?> properties, org.opengis.referencing.datum.DatumFactory factory) Creates a parametric datum.private static StringdimensionNotFound(short resourceKey, org.opengis.referencing.crs.CoordinateReferenceSystem crs) Creates an exception message for a spatial, vertical or temporal dimension not found.org.opengis.geometry.DirectPositiongeographic(double λ, double φ) Creates a two-dimensional geographic position associated to the default geographic CRS.org.opengis.referencing.operation.CoordinateOperationFactoryReturns the default coordinate operation factory.getInformation(String key, Locale locale) Returns information about the Apache SIS configuration.private static org.opengis.referencing.operation.OperationMethodgetOperationMethod(Iterable<? extends org.opengis.referencing.operation.OperationMethod> methods, String identifier) Returns the operation method for the specified name or identifier.static org.opengis.referencing.operation.OperationMethodgetOperationMethod(org.opengis.referencing.operation.CoordinateOperationFactory opFactory, org.opengis.referencing.operation.MathTransformFactory mtFactory, String identifier) Returns the coordinate operation method for the given classification.getPreferredIdentifier(org.opengis.referencing.IdentifiedObject object) Returns an identifier for the given object, giving precedence to EPSG identifier if available.org.opengis.util.TypeNamegetValueType(org.opengis.parameter.ParameterDescriptor<?> parameter) Returns the name of the type of values.setBounds(org.opengis.geometry.Envelope envelope, DefaultGeographicBoundingBox target, String findOpCaller) Sets a geographic bounding box from the specified envelope.voidsetBounds(org.opengis.geometry.Envelope envelope, DefaultSpatialTemporalExtent target) Sets the geographic, vertical and temporal extents with the values inferred from the given envelope.voidsetBounds(org.opengis.geometry.Envelope envelope, DefaultTemporalExtent target) Sets a temporal extent with the value inferred from the given envelope.voidsetBounds(org.opengis.geometry.Envelope envelope, DefaultVerticalExtent target) Sets a vertical extent with the value inferred from the given envelope.private static DefaultGeographicBoundingBoxsetGeographicExtent(org.opengis.geometry.Envelope envelope, DefaultGeographicBoundingBox target, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.crs.GeographicCRS normalizedCRS, String findOpCaller) Implementation of the publicsetBounds(…, DefaultGeographicBoundingBox, …)methods for the horizontal extent.private static voidsetVerticalExtent(org.opengis.geometry.Envelope envelope, DefaultVerticalExtent target, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.crs.VerticalCRS verticalCRS) Implementation of the publicsetBoundsmethods for the vertical extent.<T> org.opengis.parameter.ParameterDescriptor<T>toImplementation(org.opengis.parameter.ParameterDescriptor<T> parameter) Returns a fully implemented parameter descriptor.Methods inherited from class org.apache.sis.internal.metadata.ReferencingServices
classpathChanged, getInstanceMethods inherited from class org.apache.sis.internal.system.OptionalDependency
getInstance, moduleNotFoundMethods inherited from class org.apache.sis.internal.system.SystemListener
add, databaseChanged, fireClasspathChanged, remove
-
Field Details
-
CONNECTION
Name of anOnLineFunctioncode list value, used for transferring information about the EPSG database.- See Also:
-
-
Constructor Details
-
ServicesForMetadata
public ServicesForMetadata()Creates a new instance. This constructor is invoked by reflection only.
-
-
Method Details
-
dimensionNotFound
private static String dimensionNotFound(short resourceKey, org.opengis.referencing.crs.CoordinateReferenceSystem crs) Creates an exception message for a spatial, vertical or temporal dimension not found. The given key must be one ofResources.Keysconstants. -
setGeographicExtent
private static DefaultGeographicBoundingBox setGeographicExtent(org.opengis.geometry.Envelope envelope, DefaultGeographicBoundingBox target, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.crs.GeographicCRS normalizedCRS, String findOpCaller) throws org.opengis.referencing.operation.TransformException Implementation of the publicsetBounds(…, DefaultGeographicBoundingBox, …)methods for the horizontal extent. If thecrsargument is null, then it is caller's responsibility to ensure that the given envelope is two-dimensional.If
findOpCalleris non-null, then this method will be executed in optional mode: some failures will cause this method to returnnullinstead of throwing an exception. Note thatTransformExceptionmay still be thrown but not directly by this method. Warning may be logged, but in such case this method presumes that public caller is the named method fromEnvelopes— typicallyEnvelopes.findOperation(Envelope, Envelope).- Parameters:
envelope- the source envelope.target- the target bounding box, ornullfor creating it automatically.crs- the envelope CRS, ornullif unknown.normalizedCRS- the horizontal component of the given CRS, or null if thecrsargument is null.findOpCaller- non-null for replacing some (not all) exceptions bynullreturn value.- Returns:
- the bounding box or
nullon failure. NevernulliffindOpCallerargument isnull. - Throws:
org.opengis.referencing.operation.TransformException- if the given envelope cannot be transformed.
-
setVerticalExtent
private static void setVerticalExtent(org.opengis.geometry.Envelope envelope, DefaultVerticalExtent target, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.crs.VerticalCRS verticalCRS) Implementation of the publicsetBoundsmethods for the vertical extent. If thecrsargument is null, then it is caller's responsibility to ensure that the given envelope is one-dimensional.- Parameters:
envelope- the source envelope.target- the target vertical extent.crs- the envelope CRS, ornullif unknown.verticalCRS- the vertical component of the given CRS, or null if thecrsargument is null.
-
setBounds
public DefaultGeographicBoundingBox setBounds(org.opengis.geometry.Envelope envelope, DefaultGeographicBoundingBox target, String findOpCaller) throws org.opengis.referencing.operation.TransformException Sets a geographic bounding box from the specified envelope. If the envelope has no CRS, then (longitude, latitude) axis order is assumed. If the envelope CRS is not geographic, then the envelope will be transformed to a geographic CRS. IffindOpCalleristrue, then some failures will cause this method to returnnullinstead of throwing an exception, and warning may be logged with assumption that caller is the named method fromEnvelopes— typicallyEnvelopes.findOperation(Envelope, Envelope).- Overrides:
setBoundsin classReferencingServices- Parameters:
envelope- the source envelope.target- the target bounding box, ornullfor creating it automatically.findOpCaller- non-null for replacing some (not all) exceptions bynullreturn value.- Returns:
- the bounding box or
nullon failure. NevernulliffindOpCallerargument isnull. - Throws:
org.opengis.referencing.operation.TransformException- if the given envelope cannot be transformed.
-
setBounds
public void setBounds(org.opengis.geometry.Envelope envelope, DefaultVerticalExtent target) throws org.opengis.referencing.operation.TransformException Sets a vertical extent with the value inferred from the given envelope. Only the vertical coordinates are extracted; all other coordinates are ignored.- Overrides:
setBoundsin classReferencingServices- Parameters:
envelope- the source envelope.target- the target vertical extent where to store envelope information.- Throws:
org.opengis.referencing.operation.TransformException- if no vertical component can be extracted from the given envelope.
-
setBounds
public void setBounds(org.opengis.geometry.Envelope envelope, DefaultTemporalExtent target) throws org.opengis.referencing.operation.TransformException Sets a temporal extent with the value inferred from the given envelope. Only the vertical coordinates are extracted; all other coordinates are ignored.- Overrides:
setBoundsin classReferencingServices- Parameters:
envelope- the source envelope.target- the target temporal extent where to store envelope information.- Throws:
org.opengis.referencing.operation.TransformException- if no temporal component can be extracted from the given envelope.
-
setBounds
public void setBounds(org.opengis.geometry.Envelope envelope, DefaultSpatialTemporalExtent target) throws org.opengis.referencing.operation.TransformException Sets the geographic, vertical and temporal extents with the values inferred from the given envelope. If the giventargethas more geographic or vertical extents than needed (0 or 1), then the extraneous extents are removed.- Overrides:
setBoundsin classReferencingServices- Parameters:
envelope- the source envelope.target- the target spatiotemporal extent where to store envelope information.- Throws:
org.opengis.referencing.operation.TransformException- if no temporal component can be extracted from the given envelope.
-
addElements
public void addElements(org.opengis.geometry.Envelope envelope, DefaultExtent target) throws org.opengis.referencing.operation.TransformException Initializes a horizontal, vertical and temporal extent with the values inferred from the given envelope.- Overrides:
addElementsin classReferencingServices- Parameters:
envelope- the source envelope.target- the target extent where to store envelope information.- Throws:
org.opengis.referencing.operation.TransformException- if a coordinate transformation was required and failed.UnsupportedOperationException- if this method requires an Apache SIS module which has been found on the classpath.
-
geographic
public org.opengis.geometry.DirectPosition geographic(double λ, double φ) Creates a two-dimensional geographic position associated to the default geographic CRS. Axis order is (longitude, latitude).- Overrides:
geographicin classReferencingServices- Parameters:
\u03bb- the longitude value.\u03c6- the latitude value.- Returns:
- the direct position for the given geographic coordinate.
- Since:
- 0.8
-
getPreferredIdentifier
public String getPreferredIdentifier(org.opengis.referencing.IdentifiedObject object) throws org.opengis.util.FactoryException Returns an identifier for the given object, giving precedence to EPSG identifier if available. The returned string should be of the form"AUTHORITY:CODE"if possible (no guarantees).- Overrides:
getPreferredIdentifierin classReferencingServices- Parameters:
object- the object for which to get an identifier.- Returns:
- an identifier for the given object, with preference given to EPSG codes.
- Throws:
org.opengis.util.FactoryException- if an error occurred while searching for the EPSG code.- Since:
- 1.0
-
getValueType
public org.opengis.util.TypeName getValueType(org.opengis.parameter.ParameterDescriptor<?> parameter) Returns the name of the type of values.- Overrides:
getValueTypein classReferencingServices- Parameters:
parameter- parameter for which to get the name of type of values, ornull.- Returns:
- name of type of values, or
nullif not supported by given implementation.
-
toImplementation
public <T> org.opengis.parameter.ParameterDescriptor<T> toImplementation(org.opengis.parameter.ParameterDescriptor<T> parameter) Returns a fully implemented parameter descriptor.- Overrides:
toImplementationin classReferencingServices- Type Parameters:
T- the type of values.- Parameters:
parameter- a partially implemented parameter descriptor, ornull.- Returns:
- a fully implemented parameter descriptor, or
nullif the given argument was null.
-
createParametricCS
public static org.opengis.referencing.cs.CoordinateSystem createParametricCS(Map<String, ?> properties, org.opengis.referencing.cs.CoordinateSystemAxis axis, org.opengis.referencing.cs.CSFactory factory) throws org.opengis.util.FactoryExceptionCreates a parametric CS. This method requires the SIS factory since parametric CRS were not available in GeoAPI 3.0.This method is actually not needed anymore for
sis-metadatamodule, but is still defined here for historical reason. This method is removed on SIS branches using a GeoAPI versions more recent than 3.0.- Parameters:
properties- the coordinate system name, and optionally other properties.axis- the axis of the parametric coordinate system.factory- the factory to use for creating the coordinate system.- Returns:
- a parametric coordinate system using the given axes.
- Throws:
org.opengis.util.FactoryException- if the parametric object creation failed.- Since:
- 0.7
-
createParametricDatum
public static org.opengis.referencing.datum.Datum createParametricDatum(Map<String, ?> properties, org.opengis.referencing.datum.DatumFactory factory) throws org.opengis.util.FactoryExceptionCreates a parametric datum. This method requires the SIS factory since parametric CRS were not available in GeoAPI 3.0.This method is actually not needed anymore for
sis-metadatamodule, but is still defined here for historical reason. This method is removed on SIS branches using a GeoAPI versions more recent than 3.0.- Parameters:
properties- the datum name, and optionally other properties.factory- the factory to use for creating the datum.- Returns:
- a parametric datum using the given name.
- Throws:
org.opengis.util.FactoryException- if the parametric object creation failed.- Since:
- 0.7
-
createParametricCRS
public static org.opengis.referencing.crs.SingleCRS createParametricCRS(Map<String, ?> properties, org.opengis.referencing.datum.Datum datum, org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.crs.CRSFactory factory) throws org.opengis.util.FactoryExceptionCreates a parametric CRS. This method requires the SIS factory since parametric CRS were not available in GeoAPI 3.0.This method is actually not needed anymore for
sis-metadatamodule, but is still defined here for historical reason. This method is removed on SIS branches using a GeoAPI versions more recent than 3.0.- Parameters:
properties- the coordinate reference system name, and optionally other properties.datum- the parametric datum.cs- the parametric coordinate system.factory- the factory to use for creating the coordinate reference system.- Returns:
- a parametric coordinate system using the given axes.
- Throws:
org.opengis.util.FactoryException- if the parametric object creation failed.- Since:
- 0.7
-
createCoordinateFormat
Creates a format forDirectPositioninstances.- Overrides:
createCoordinateFormatin classReferencingServices- Parameters:
locale- the locale for the newFormat, ornullforLocale.ROOT.timezone- the timezone, ornullfor UTC.- Returns:
- a
CoordinateFormat. - Since:
- 0.8
-
getCoordinateOperationFactory
public org.opengis.referencing.operation.CoordinateOperationFactory getCoordinateOperationFactory()Returns the default coordinate operation factory.- Overrides:
getCoordinateOperationFactoryin classReferencingServices- Returns:
- the coordinate operation factory to use.
-
getOperationMethod
public static org.opengis.referencing.operation.OperationMethod getOperationMethod(org.opengis.referencing.operation.CoordinateOperationFactory opFactory, org.opengis.referencing.operation.MathTransformFactory mtFactory, String identifier) throws org.opengis.util.FactoryException Returns the coordinate operation method for the given classification. This method checks if the givenopFactoryis a SIS implementation before to fallback on a slower fallback.This method is actually not needed anymore for
sis-metadatamodule, but is still defined here for historical reason. This method is removed on SIS branches using a GeoAPI versions more recent than 3.0.- Parameters:
opFactory- The coordinate operation factory to use if it is a SIS implementation.mtFactory- The math transform factory to use as a fallback.identifier- The name or identifier of the operation method to search.- Returns:
- The coordinate operation method for the given name or identifier.
- Throws:
org.opengis.util.FactoryException- if an error occurred which searching for the given method.- Since:
- 0.6
-
getOperationMethod
private static org.opengis.referencing.operation.OperationMethod getOperationMethod(Iterable<? extends org.opengis.referencing.operation.OperationMethod> methods, String identifier) Returns the operation method for the specified name or identifier. The given argument shall be either a method name (e.g. "Transverse Mercator") or one of its identifiers (e.g."EPSG:9807").- Parameters:
methods- the method candidates.identifier- the name or identifier of the operation method to search.- Returns:
- the coordinate operation method for the given name or identifier, or
nullif none. - Since:
- 0.6
- See Also:
-
getInformation
Returns information about the Apache SIS configuration. See super-class for a list of keys.- Overrides:
getInformationin classReferencingServices- Parameters:
key- a key identifying the information to return.locale- language to use if possible.- Returns:
- the information, or
nullif none. - See Also:
-