Class GeodeticObjectFactory
- All Implemented Interfaces:
Parser
,CRSFactory
,CSFactory
,DatumFactory
,ObjectFactory
,Factory
- For users, allows the creation of complex objects that cannot be created by the authority factories, without explicit dependency to Apache SIS (when using the GeoAPI interfaces implemented by this class).
- For providers, allows inversion of control by overriding methods in this class,
then specifying the customized instance to other services that consume
CRSFactory
(for example authority factories or WKT parsers).
GeodeticObjectFactory
class is not easy to use directly.
Users are encouraged to use an authority factory instead
(or the CRS.forCode(String)
convenience method)
when the CRS object to construct can be identified by a code in the namespace of an authority (typically EPSG).
Object properties
Most factory methods expect aMap<String,?>
argument, often followed by explicit arguments.
Unless otherwise noticed, information provided in the properties
map are considered ignorable metadata
while information provided in explicit arguments have an impact on coordinate transformation results.
The following table lists the keys recognized by the GeodeticObjectFactory
default implementation,
together with the type of values associated to those keys.
A value for the "name"
key is mandatory for all objects, while all other properties are optional.
GeodeticObjectFactory
methods ignore all unknown properties.
Localization
All localizable attributes like"remarks"
may have a language and country code suffix.
For example, the "remarks_fr"
property stands for remarks in French and
the "remarks_fr_CA"
property stands for remarks in French Canadian.
They are convenience properties for building the InternationalString
value.
The "locale"
property applies only in case of exception for formatting the error message, and
is used only on a best effort basis. The locale is discarded after successful construction
since localizations are applied by the InternationalString.toString(Locale)
method.
- Since:
- 0.6
-
Constructor Summary
ConstructorDescriptionConstructs a factory with no default properties.GeodeticObjectFactory
(Map<String, ?> properties) Constructs a factory with the given default properties. -
Method Summary
Modifier and TypeMethodDescriptionReturns the union of the givenproperties
map with the default properties given at construction time.createAffineCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates a two-dimensional affine coordinate system from the given pair of axis.createAffineCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates a three-dimensional affine coordinate system from the given set of axis.createCartesianCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates a two-dimensional Cartesian coordinate system from the given pair of axis.createCartesianCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates a three-dimensional Cartesian coordinate system from the given set of axis.createCompoundCRS
(Map<String, ?> properties, CoordinateReferenceSystem... components) Creates a compound coordinate reference system from an ordered list of CRS components.createCoordinateSystemAxis
(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit) Creates a coordinate system axis from an abbreviation and a unit.createCylindricalCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates a cylindrical coordinate system from the given set of axis.createDerivedCRS
(Map<String, ?> properties, CoordinateReferenceSystem baseCRS, Conversion conversion, CoordinateSystem derivedCS) Creates a derived coordinate reference system from a conversion.createEllipsoid
(Map<String, ?> properties, double semiMajorAxis, double semiMinorAxis, Unit<Length> unit) Creates an ellipsoid from semi-axis length values.createEllipsoidalCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates an ellipsoidal coordinate system without ellipsoidal height.createEllipsoidalCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates an ellipsoidal coordinate system with ellipsoidal height.createEngineeringCRS
(Map<String, ?> properties, EngineeringDatum datum, CoordinateSystem cs) Creates a engineering coordinate reference system.createEngineeringDatum
(Map<String, ?> properties) Creates an engineering datum.createFlattenedSphere
(Map<String, ?> properties, double semiMajorAxis, double inverseFlattening, Unit<Length> unit) Creates an ellipsoid from a major semi-axis length and inverse flattening.createFromWKT
(String text) Creates a Coordinate Reference System object from a Well Known Text (WKT).createFromXML
(String xml) Creates a coordinate reference system object from a XML string.createGeocentricCRS
(Map<String, ?> properties, GeodeticDatum datum, CartesianCS cs) Creates a geocentric coordinate reference system from a Cartesian coordinate system.createGeocentricCRS
(Map<String, ?> properties, GeodeticDatum datum, SphericalCS cs) Creates a geocentric coordinate reference system from a spherical coordinate system.createGeodeticDatum
(Map<String, ?> properties, Ellipsoid ellipsoid, PrimeMeridian primeMeridian) Creates geodetic datum from ellipsoid and (optionally) Bursa-Wolf parameters.createGeographicCRS
(Map<String, ?> properties, GeodeticDatum datum, EllipsoidalCS cs) Creates a geographic coordinate reference system.createImageCRS
(Map<String, ?> properties, ImageDatum datum, AffineCS cs) Creates an image coordinate reference system.createImageDatum
(Map<String, ?> properties, PixelInCell pixelInCell) Creates an image datum.createLinearCS
(Map<String, ?> properties, CoordinateSystemAxis axis) Creates a linear coordinate system.createParametricCRS
(Map<String, ?> properties, DefaultParametricDatum datum, DefaultParametricCS cs) Creates a parametric coordinate reference system.createParametricCS
(Map<String, ?> properties, CoordinateSystemAxis axis) Creates a parametric coordinate system.createParametricDatum
(Map<String, ?> properties) Creates a parametric datum.createPolarCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates a polar coordinate system from the given pair of axis.createPrimeMeridian
(Map<String, ?> properties, double longitude, Unit<Angle> angularUnit) Creates a prime meridian, relative to Greenwich.createProjectedCRS
(Map<String, ?> properties, GeographicCRS baseCRS, Conversion conversion, CartesianCS derivedCS) Creates a projected coordinate reference system from a conversion.createSphericalCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates a spherical coordinate system without radius.createSphericalCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates a spherical coordinate system from the given set of axis.createTemporalCRS
(Map<String, ?> properties, TemporalDatum datum, TimeCS cs) Creates a temporal coordinate reference system.createTemporalDatum
(Map<String, ?> properties, Date origin) Creates a temporal datum from an enumerated type value.createTimeCS
(Map<String, ?> properties, CoordinateSystemAxis axis) Creates a temporal coordinate system.createUserDefinedCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) Creates a two-dimensional user defined coordinate system from the given pair of axis.createUserDefinedCS
(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) Creates a three-dimensional user defined coordinate system from the given set of axis.createVerticalCRS
(Map<String, ?> properties, VerticalDatum datum, VerticalCS cs) Creates a vertical coordinate reference system.createVerticalCS
(Map<String, ?> properties, CoordinateSystemAxis axis) Creates a vertical coordinate system.createVerticalDatum
(Map<String, ?> properties, VerticalDatumType type) Creates a vertical datum from an enumerated type value.static GeodeticObjectFactory
provider()
Returns the default provider ofIdentifiedObject
instances.Methods inherited from class AbstractFactory
getVendor
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Factory
getVendor
-
Constructor Details
-
GeodeticObjectFactory
public GeodeticObjectFactory()Constructs a factory with no default properties.- See Also:
-
GeodeticObjectFactory
Constructs a factory with the given default properties.GeodeticObjectFactory
will fallback on the map given to this constructor for any property not present in the map provided to acreateFoo(Map<String,?>, …)
method.- Parameters:
properties
- the default properties, ornull
if none.
-
-
Method Details
-
provider
Returns the default provider ofIdentifiedObject
instances. This is the factory used by the Apache SIS library when no non-nullCRSFactory
,CSFactory
orDatumFactory
has been explicitly specified. This method can be invoked directly, or indirectly throughServiceLoader.load(T)
where T is one of above-cited interfaces.- Returns:
- the default provider of geodetic objects.
- Since:
- 1.4
- See Also:
-
complete
Returns the union of the givenproperties
map with the default properties given at construction time. Entries in the given properties map have precedence, even if their value isnull
(i.e. a null value "erase" the default property value). Entries with null value after the union will be omitted.This method is invoked by all
createFoo(Map<String,?>, …)
methods. Subclasses can override this method if they want to add, remove or edit property values with more flexibility than constant values specified at construction time.- Parameters:
properties
- the properties supplied in a call to acreateFoo(Map, …)
method.- Returns:
- the union of the given properties with the default properties.
-
createGeocentricCRS
public GeocentricCRS createGeocentricCRS(Map<String, ?> properties, GeodeticDatum datum, CartesianCS cs) throws FactoryExceptionCreates a geocentric coordinate reference system from a Cartesian coordinate system. Geocentric CRS have their origin at the approximate centre of mass of the earth. An alternate method allows creation of the same kind of CRS with spherical coordinate system instead of a Cartesian one.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
- One of:
createPrimeMeridian(Map, double, Unit)
createGeodeticDatum(Map, Ellipsoid, PrimeMeridian)
DefaultGeocentricCRS
instance.- Specified by:
createGeocentricCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- the geodetic datum to use in created CRS.cs
- the three-dimensional Cartesian coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCartesianCS
public CartesianCS createCartesianCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates a three-dimensional Cartesian coordinate system from the given set of axis. This coordinate system can be used with geocentric, engineering and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultCartesianCS
instance.- Specified by:
createCartesianCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Geocentric X”).axis1
- the second axis (e.g. “Geocentric Y”).axis2
- the third axis (e.g. “Geocentric Z”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createGeocentricCRS
public GeocentricCRS createGeocentricCRS(Map<String, ?> properties, GeodeticDatum datum, SphericalCS cs) throws FactoryExceptionCreates a geocentric coordinate reference system from a spherical coordinate system. Geocentric CRS have their origin at the approximate centre of mass of the earth. An alternate method allows creation of the same kind of CRS with Cartesian coordinate system instead of a spherical one.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createSphericalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis, CoordinateSystemAxis)
- One of:
createPrimeMeridian(Map, double, Unit)
createGeodeticDatum(Map, Ellipsoid, PrimeMeridian)
DefaultGeocentricCRS
instance.- Specified by:
createGeocentricCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- geodetic datum to use in created CRS.cs
- the spherical coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createSphericalCS
public SphericalCS createSphericalCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates a spherical coordinate system from the given set of axis. This coordinate system can be used with geocentric, engineering and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultSphericalCS
instance.- Specified by:
createSphericalCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Spherical latitude”).axis1
- the second axis (e.g. “Spherical longitude”).axis2
- the third axis (e.g. “Geocentric radius”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createSphericalCS
public SphericalCS createSphericalCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates a spherical coordinate system without radius. This coordinate system can be used with geocentric, engineering and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultSphericalCS
instance.- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Spherical latitude”).axis1
- the second axis (e.g. “Spherical longitude”).- Throws:
FactoryException
- if the object creation failed.- Since:
- 1.4
- See Also:
-
createGeographicCRS
public GeographicCRS createGeographicCRS(Map<String, ?> properties, GeodeticDatum datum, EllipsoidalCS cs) throws FactoryExceptionCreates a geographic coordinate reference system. It can be (latitude, longitude) or (longitude, latitude), optionally with an ellipsoidal height.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
- One of:
- One of:
createPrimeMeridian(Map, double, Unit)
createGeodeticDatum(Map, Ellipsoid, PrimeMeridian)
DefaultGeographicCRS
instance.- Specified by:
createGeographicCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- geodetic datum to use in created CRS.cs
- the two- or three-dimensional ellipsoidal coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createGeodeticDatum
public GeodeticDatum createGeodeticDatum(Map<String, ?> properties, Ellipsoid ellipsoid, PrimeMeridian primeMeridian) throws FactoryExceptionCreates geodetic datum from ellipsoid and (optionally) Bursa-Wolf parameters. Geodetic datum defines the location and orientation of an ellipsoid that approximates the shape of the earth. This datum can be used with geographic, geocentric and engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultGeodeticDatum
instance.- Specified by:
createGeodeticDatum
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.ellipsoid
- the ellipsoid to use in new geodetic datum.primeMeridian
- the prime meridian to use in new geodetic datum.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createPrimeMeridian
public PrimeMeridian createPrimeMeridian(Map<String, ?> properties, double longitude, Unit<Angle> angularUnit) throws FactoryExceptionCreates a prime meridian, relative to Greenwich. Defines the origin from which longitude values are determined.The default implementation creates a
DefaultPrimeMeridian
instance.- Specified by:
createPrimeMeridian
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.longitude
- the longitude of prime meridian in supplied angular units East of Greenwich.angularUnit
- the angular units of longitude.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEllipsoidalCS
public EllipsoidalCS createEllipsoidalCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates an ellipsoidal coordinate system without ellipsoidal height. It can be (latitude, longitude) or (longitude, latitude).Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultEllipsoidalCS
instance.- Specified by:
createEllipsoidalCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Geodetic latitude”).axis1
- the second axis (e.g. “Geodetic longitude”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEllipsoidalCS
public EllipsoidalCS createEllipsoidalCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates an ellipsoidal coordinate system with ellipsoidal height. It can be (latitude, longitude, height) or (longitude, latitude, height).Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultEllipsoidalCS
instance.- Specified by:
createEllipsoidalCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Geodetic latitude”).axis1
- the second axis (e.g. “Geodetic longitude”).axis2
- the third axis (e.g. “Ellipsoidal height”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEllipsoid
public Ellipsoid createEllipsoid(Map<String, ?> properties, double semiMajorAxis, double semiMinorAxis, Unit<Length> unit) throws FactoryExceptionCreates an ellipsoid from semi-axis length values. The default implementation creates aDefaultEllipsoid
instance.- Specified by:
createEllipsoid
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.semiMajorAxis
- the equatorial radius in supplied linear units.semiMinorAxis
- the polar radius in supplied linear units.unit
- the linear units of ellipsoid axes.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createFlattenedSphere
public Ellipsoid createFlattenedSphere(Map<String, ?> properties, double semiMajorAxis, double inverseFlattening, Unit<Length> unit) throws FactoryExceptionCreates an ellipsoid from a major semi-axis length and inverse flattening. The default implementation creates aDefaultEllipsoid
instance.- Specified by:
createFlattenedSphere
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.semiMajorAxis
- the equatorial radius in supplied linear units.inverseFlattening
- the eccentricity of ellipsoid.unit
- the linear units of major axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createProjectedCRS
public ProjectedCRS createProjectedCRS(Map<String, ?> properties, GeographicCRS baseCRS, Conversion conversion, CartesianCS derivedCS) throws FactoryExceptionCreates a projected coordinate reference system from a conversion. Projected CRS are used to approximate the shape of the earth on a planar surface in such a way that the distortion that is inherent to the approximation is controlled and known.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createCartesianCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
createEllipsoidalCS(Map, CoordinateSystemAxis, CoordinateSystemAxis)
- One of:
createPrimeMeridian(Map, double, Unit)
createGeodeticDatum(Map, Ellipsoid, PrimeMeridian)
createGeographicCRS(Map, GeodeticDatum, EllipsoidalCS)
DefaultCoordinateOperationFactory.createDefiningConversion(Map, OperationMethod, ParameterValueGroup)
conversion
argument shall not includes the operation steps for performing unit conversions and change of axis order since those operations will be inferred by this constructor.The default implementation creates a
DefaultProjectedCRS
instance.- Specified by:
createProjectedCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.baseCRS
- the geographic coordinate reference system to base projection on.conversion
- the defining conversion from a normalized base to a normalized derived CRS.derivedCS
- the coordinate system for the projected CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCartesianCS
public CartesianCS createCartesianCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates a two-dimensional Cartesian coordinate system from the given pair of axis. This coordinate system can be used with projected, engineering and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultCartesianCS
instance.- Specified by:
createCartesianCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis (e.g. “Easting”).axis1
- the second axis (e.g. “Northing”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createDerivedCRS
public DerivedCRS createDerivedCRS(Map<String, ?> properties, CoordinateReferenceSystem baseCRS, Conversion conversion, CoordinateSystem derivedCS) throws FactoryExceptionCreates a derived coordinate reference system from a conversion. The derived CRS returned by this method may also implement theGeodeticCRS
,VerticalCRS
,TemporalCRS
orEngineeringCRS
interface depending on the type of the base CRS and the coordinate system.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
- A
createFooCS(…)
method for Cartesian, spherical, ellipsoidal, vertical, temporal, linear, affine, polar, cylindrical or user-defined CS. - Another
createFooCRS(…)
method for geocentric, geographic, vertical, temporal or engineering CRS. DefaultCoordinateOperationFactory.createDefiningConversion(Map, OperationMethod, ParameterValueGroup)
conversion
argument shall not includes the operation steps for performing unit conversions and change of axis order since those operations will be inferred by this constructor.The default implementation creates a
DefaultDerivedCRS
instance.- Specified by:
createDerivedCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.baseCRS
- the coordinate reference system to base projection on. Shall be an instance ofSingleCRS
.conversion
- the defining conversion from a normalized base to a normalized derived CRS.derivedCS
- the coordinate system for the derived CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createVerticalCRS
public VerticalCRS createVerticalCRS(Map<String, ?> properties, VerticalDatum datum, VerticalCS cs) throws FactoryExceptionCreates a vertical coordinate reference system. Vertical CRSs make use of the direction of gravity to define the concept of height or depth, but the relationship with gravity may not be straightforward.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createVerticalCS(Map, CoordinateSystemAxis)
createVerticalDatum(Map, VerticalDatumType)
DefaultVerticalCRS
instance.- Specified by:
createVerticalCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- the vertical datum to use in created CRS.cs
- the vertical coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createVerticalDatum
public VerticalDatum createVerticalDatum(Map<String, ?> properties, VerticalDatumType type) throws FactoryExceptionCreates a vertical datum from an enumerated type value. The default implementation creates aDefaultVerticalDatum
instance.- Specified by:
createVerticalDatum
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.type
- the type of this vertical datum (often geoidal).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createVerticalCS
public VerticalCS createVerticalCS(Map<String, ?> properties, CoordinateSystemAxis axis) throws FactoryExceptionCreates a vertical coordinate system. This coordinate system can be used with vertical and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultVerticalCS
instance.- Specified by:
createVerticalCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis
- the single axis (e.g. “height” or “depth”).- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createTemporalCRS
public TemporalCRS createTemporalCRS(Map<String, ?> properties, TemporalDatum datum, TimeCS cs) throws FactoryExceptionCreates a temporal coordinate reference system.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createTimeCS(Map, CoordinateSystemAxis)
createTemporalDatum(Map, Date)
DefaultTemporalCRS
instance.- Specified by:
createTemporalCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- the temporal datum to use in created CRS.cs
- the temporal coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createTemporalDatum
public TemporalDatum createTemporalDatum(Map<String, ?> properties, Date origin) throws FactoryExceptionCreates a temporal datum from an enumerated type value. The default implementation creates aDefaultTemporalDatum
instance.- Specified by:
createTemporalDatum
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.origin
- the date and time origin of this temporal datum.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createTimeCS
public TimeCS createTimeCS(Map<String, ?> properties, CoordinateSystemAxis axis) throws FactoryExceptionCreates a temporal coordinate system. This coordinate system can be used with temporal and derived CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultTimeCS
instance.- Specified by:
createTimeCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis
- the single axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createParametricCRS
public DefaultParametricCRS createParametricCRS(Map<String, ?> properties, DefaultParametricDatum datum, DefaultParametricCS cs) throws FactoryExceptionCreates a parametric coordinate reference system. Parametric CRS can be used for physical properties or functions that vary monotonically with height. A typical example is the pressure in meteorological applications.Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
createParametricCS(Map, CoordinateSystemAxis)
createParametricDatum(Map)
DefaultParametricCRS
instance.Warning: in a future SIS version, the parameter types may be changed toorg.opengis.referencing.datum.ParametricDatum
andorg.opengis.referencing.cs.ParametricCS
, and the return type may be changed toorg.opengis.referencing.crs.ParametricCRS
. Those change are pending GeoAPI revision.- Parameters:
properties
- name and other properties to give to the new object.datum
- the parametric datum to use in created CRS.cs
- the parametric coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createParametricDatum
public DefaultParametricDatum createParametricDatum(Map<String, ?> properties) throws FactoryExceptionCreates a parametric datum. The default implementation creates aDefaultParametricDatum
instance.Warning: in a future SIS version, the return type may be changed toorg.opengis.referencing.datum.ParametricDatum
. This change is pending GeoAPI revision.- Parameters:
properties
- name and other properties to give to the new object.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createParametricCS
public DefaultParametricCS createParametricCS(Map<String, ?> properties, CoordinateSystemAxis axis) throws FactoryExceptionCreates a parametric coordinate system. This coordinate system can be used only with parametric CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultParametricCS
instance.Warning: in a future SIS version, the return type may be changed toorg.opengis.referencing.cs.ParametricCS
. This change is pending GeoAPI revision.- Parameters:
properties
- name and other properties to give to the new object.axis
- the single axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCompoundCRS
public CompoundCRS createCompoundCRS(Map<String, ?> properties, CoordinateReferenceSystem... components) throws FactoryExceptionCreates a compound coordinate reference system from an ordered list of CRS components. Apache SIS is permissive on the order of components that can be used in a compound CRS. However for better inter-operability, users are encouraged to follow the order mandated by ISO 19162:- A mandatory horizontal CRS (only one of two-dimensional
GeographicCRS
orProjectedCRS
orEngineeringCRS
). - Optionally followed by a
VerticalCRS
or aParametricCRS
(but not both). - Optionally followed by a
TemporalCRS
.
DefaultCompoundCRS
instance.- Specified by:
createCompoundCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.components
- the sequence of coordinate reference systems making the compound CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
- A mandatory horizontal CRS (only one of two-dimensional
-
createImageCRS
public ImageCRS createImageCRS(Map<String, ?> properties, ImageDatum datum, AffineCS cs) throws FactoryExceptionCreates an image coordinate reference system. The default implementation creates aDefaultImageCRS
instance.- Specified by:
createImageCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- the image datum to use in created CRS.cs
- the Cartesian or oblique Cartesian coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createImageDatum
public ImageDatum createImageDatum(Map<String, ?> properties, PixelInCell pixelInCell) throws FactoryExceptionCreates an image datum. The default implementation creates aDefaultImageDatum
instance.- Specified by:
createImageDatum
in interfaceDatumFactory
- Parameters:
properties
- Name and other properties to give to the new object.pixelInCell
- Specification of the way the image grid is associated with the image data attributes.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createAffineCS
public AffineCS createAffineCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates a two-dimensional affine coordinate system from the given pair of axis. This coordinate system can be used with image and engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultAffineCS
instance.- Specified by:
createAffineCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEngineeringCRS
public EngineeringCRS createEngineeringCRS(Map<String, ?> properties, EngineeringDatum datum, CoordinateSystem cs) throws FactoryExceptionCreates a engineering coordinate reference system. Engineering CRS can be divided into two broad categories:- earth-fixed systems applied to engineering activities on or near the surface of the earth;
- CRSs on moving platforms such as road vehicles, vessels, aircraft, or spacecraft.
Dependencies
The components needed by this method can be created by the following methods:createCoordinateSystemAxis(Map, String, AxisDirection, Unit)
- A
createFooCS(…)
method for Cartesian, spherical, linear, affine, polar, cylindrical or user-defined CS. createEngineeringDatum(Map)
DefaultEngineeringCRS
instance.- Specified by:
createEngineeringCRS
in interfaceCRSFactory
- Parameters:
properties
- name and other properties to give to the new object.datum
- the engineering datum to use in created CRS.cs
- the coordinate system for the created CRS.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createEngineeringDatum
Creates an engineering datum. The default implementation creates aDefaultEngineeringDatum
instance.- Specified by:
createEngineeringDatum
in interfaceDatumFactory
- Parameters:
properties
- name and other properties to give to the new object.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createAffineCS
public AffineCS createAffineCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates a three-dimensional affine coordinate system from the given set of axis. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultAffineCS
instance.- Specified by:
createAffineCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.axis2
- the third axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCylindricalCS
public CylindricalCS createCylindricalCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates a cylindrical coordinate system from the given set of axis. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultCylindricalCS
instance.- Specified by:
createCylindricalCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.axis2
- the third axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createPolarCS
public PolarCS createPolarCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates a polar coordinate system from the given pair of axis. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultPolarCS
instance.- Specified by:
createPolarCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createLinearCS
public LinearCS createLinearCS(Map<String, ?> properties, CoordinateSystemAxis axis) throws FactoryExceptionCreates a linear coordinate system. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultLinearCS
instance.- Specified by:
createLinearCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis
- the single axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createUserDefinedCS
public UserDefinedCS createUserDefinedCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1) throws FactoryExceptionCreates a two-dimensional user defined coordinate system from the given pair of axis. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultUserDefinedCS
instance.- Specified by:
createUserDefinedCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createUserDefinedCS
public UserDefinedCS createUserDefinedCS(Map<String, ?> properties, CoordinateSystemAxis axis0, CoordinateSystemAxis axis1, CoordinateSystemAxis axis2) throws FactoryExceptionCreates a three-dimensional user defined coordinate system from the given set of axis. This coordinate system can be used with engineering CRS.Dependencies
The components needed by this method can be created by the following methods: The default implementation creates aDefaultUserDefinedCS
instance.- Specified by:
createUserDefinedCS
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.axis0
- the first axis.axis1
- the second axis.axis2
- the third axis.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createCoordinateSystemAxis
public CoordinateSystemAxis createCoordinateSystemAxis(Map<String, ?> properties, String abbreviation, AxisDirection direction, Unit<?> unit) throws FactoryExceptionCreates a coordinate system axis from an abbreviation and a unit. Note that the axis name is constrained by ISO 19111 depending on the coordinate reference system type. See the GeoAPICoordinateSystemAxis
javadoc for more information.The default implementation creates a
DefaultCoordinateSystemAxis
instance.- Specified by:
createCoordinateSystemAxis
in interfaceCSFactory
- Parameters:
properties
- name and other properties to give to the new object.abbreviation
- the coordinate axis abbreviation.direction
- the axis direction.unit
- the coordinate axis unit.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createFromXML
Creates a coordinate reference system object from a XML string. Note that the given argument is the XML document itself, not a URL to a XML document.The default implementation delegates to
XML.unmarshal(String)
- Specified by:
createFromXML
in interfaceCRSFactory
- Parameters:
xml
- coordinate reference system encoded in XML format.- Throws:
FactoryException
- if the object creation failed.- See Also:
-
createFromWKT
Creates a Coordinate Reference System object from a Well Known Text (WKT). This method understands both version 1 (a.k.a. OGC 01-009) and version 2 (a.k.a. ISO 19162) of the WKT format.Example
Below is a slightly simplified WKT 2 string for a Mercator projection. For making this example smaller, some optionalUNIT[…]
andORDER[…]
elements have been omitted.ProjectedCRS["SIRGAS 2000 / Brazil Mercator", BaseGeodCRS["SIRGAS 2000", Datum["Sistema de Referencia Geocentrico para las Americas 2000", Ellipsoid["GRS 1980", 6378137, 298.257222101]]], Conversion["Petrobras Mercator", Method["Mercator (variant B)", Id["EPSG",9805]], Parameter["Latitude of 1st standard parallel", -2], Parameter["Longitude of natural origin", -43], Parameter["False easting", 5000000], Parameter["False northing", 10000000]], CS[cartesian,2], Axis["easting (E)", east], Axis["northing (N)", north], LengthUnit["metre", 1], Id["EPSG",5641]]
Logging
If the given text contains non-fatal anomalies (unknown or unsupported WKT elements, inconsistent unit definitions, unparsable axis abbreviations, etc.), warnings may be reported in a logger named"org.apache.sis.io.wkt"
. However, this parser does not verify if the overall parsed object matches the EPSG (or other authority) definition, since this geodetic object factory is not an authority factory. For such verification, see theCRS.fromWKT(String)
convenience method.Usage and performance considerations
The default implementation uses a shared instance ofWKTFormat
with the addition of thread-safety. This is okay for occasional use, but is sub-optimal if this method is extensively used in a multi-thread environment. Furthermore, this method offers no control on the WKT conventions in use and on the handling of warnings. Applications which need to parse a large amount of WKT strings should consider to use theWKTFormat
class instead of this method.- Specified by:
createFromWKT
in interfaceCRSFactory
- Specified by:
createFromWKT
in interfaceParser
- Parameters:
text
- coordinate system encoded in Well-Known Text format (version 1 or 2).- Returns:
- the result of parsing the given text.
- Throws:
FactoryException
- if the object creation failed.- See Also:
-