Package org.geotools.referencing.factory
Class PropertyCoordinateOperationAuthorityFactory
Object
AbstractFactory
ReferencingFactory
AbstractAuthorityFactory
DirectAuthorityFactory
PropertyCoordinateOperationAuthorityFactory
- All Implemented Interfaces:
AuthorityFactory
,Factory
,CoordinateOperationAuthorityFactory
,Factory
,RegistrableFactory
public class PropertyCoordinateOperationAuthorityFactory
extends DirectAuthorityFactory
implements CoordinateOperationAuthorityFactory
A
CoordinateOperationAuthorityFactory
backed by a properties file. Allows custom transform definitions across
two CRSs, expressed as WKT math transforms. Entries in the properties file take this format:
[source crs code],[target crs code]=[WKT math transform]Examples:
4230,4258=PARAM_MT["NTv2", PARAMETER["Latitude and longitude difference file", "100800401.gsb"]] 23031,25831=PARAM_MT["Similarity transformation", \ PARAMETER["Ordinate 1 of evaluation point in target CRS", -129.549], \ PARAMETER["Ordinate 2 of evaluation point in target CRS", -208.185], \ PARAMETER["Scale difference", 1.0000015504], \ PARAMETER["Rotation angle of source coordinate reference system axes", 1.56504]]For more compact definitions, parameter names can be replaced by their corresponding EPSG codes. Following examples are the same as former ones:
4230,4258=PARAM_MT["9615", PARAMETER["8656", "100800401.gsb"]] 23031,25831=PARAM_MT["9621", \ PARAMETER["8621", -129.549], \ PARAMETER["8622", -208.185], \ PARAMETER["8611", 1.0000015504], \ PARAMETER["8614", 1.56504]]References:
See Well-Known Text format for math transform syntax. Visit the EPSG Geodetic Parameter Registry for EPSG parameter codes and values.
Note that invertible transforms will be used in both directions.
This factory doesn't cache any result. Any call to a createFoo
method will trig a new WKT parsing. For
caching, this factory should be wrapped in some buffered factory like BufferedAuthorityFactory
.
- Author:
- Oscar Fonts
-
Field Summary
Fields inherited from class DirectAuthorityFactory
factories
Fields inherited from class ReferencingFactory
LOGGER
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyCoordinateOperationAuthorityFactory
(ReferencingFactoryContainer factories, Citation authority, URL definitions) Creates a factory for the specified authority from the specified file. -
Method Summary
Modifier and TypeMethodDescriptionCreates an operation from a single operation code.createFromCoordinateReferenceSystemCodes
(String sourceCRS, String targetCRS) Creates aCoordinateOperation
from coordinate reference system codes.Returns the organization or party responsible for definition and maintenance of the database.getAuthorityCodes
(Class<? extends IdentifiedObject> type) Returns the set of authority codes of the given type.getDescriptionText
(String code) Gets a description of the object corresponding to a code.Methods inherited from class DirectAuthorityFactory
getImplementationHints
Methods inherited from class AbstractAuthorityFactory
createCartesianCS, createCompoundCRS, createCoordinateReferenceSystem, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, dispose, getBackingStoreDescription, getIdentifiedObjectFinder, noSuchAuthorityCode, trimAuthority
Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
Methods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
Methods inherited from interface AuthorityFactory
createObject
-
Constructor Details
-
PropertyCoordinateOperationAuthorityFactory
public PropertyCoordinateOperationAuthorityFactory(ReferencingFactoryContainer factories, Citation authority, URL definitions) throws IOException Creates a factory for the specified authority from the specified file.- Parameters:
factories
- The underlying factories used for objects creation.authority
- The organization or party responsible for definition and maintenance of the database.definitions
- URL to the definition file.- Throws:
IOException
- if the definitions can't be read.
-
-
Method Details
-
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws NoSuchAuthorityCodeException, FactoryException Creates an operation from a single operation code.- Specified by:
createCoordinateOperation
in interfaceCoordinateOperationAuthorityFactory
- Overrides:
createCoordinateOperation
in classAbstractAuthorityFactory
- Parameters:
code
- Coded value for operation.- Returns:
- The operation for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createFromCoordinateReferenceSystemCodes
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws NoSuchAuthorityCodeException, FactoryException Creates aCoordinateOperation
from coordinate reference system codes. This method returns a single operation from the properties file. If operation is invertible, will check also for the inverse one. If operation not found, it will return an empty set.- Specified by:
createFromCoordinateReferenceSystemCodes
in interfaceCoordinateOperationAuthorityFactory
- Overrides:
createFromCoordinateReferenceSystemCodes
in classAbstractAuthorityFactory
- Parameters:
sourceCRS
- Coded value of source coordinate reference system.targetCRS
- Coded value of target coordinate reference system.- Returns:
- The operation from
sourceCRS
totargetCRS
(one single element). - Throws:
NoSuchAuthorityCodeException
- if a specified code was not found.FactoryException
- if the object creation failed for some other reason.
-
getAuthorityCodes
Returns the set of authority codes of the given type. Only CoordinateOperation.class is accepted as type.This factory will not filter codes for its subclasses.
- Specified by:
getAuthorityCodes
in interfaceAuthorityFactory
- Parameters:
type
- The CoordinateOperation type (or null, same effect).- Returns:
- All of available authority codes, or an empty set.
-
getDescriptionText
public InternationalString getDescriptionText(String code) throws NoSuchAuthorityCodeException, FactoryException Gets a description of the object corresponding to a code.- Specified by:
getDescriptionText
in interfaceAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- A description of the object, or
null
if the object corresponding to the specifiedcode
has no description. - Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the query failed for some other reason.
-
getAuthority
Returns the organization or party responsible for definition and maintenance of the database.- Specified by:
getAuthority
in interfaceAuthorityFactory
- Specified by:
getAuthority
in classAbstractAuthorityFactory
- Returns:
- The organization reponsible for definition of the database.
-