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
ACoordinateOperationAuthorityFactorybacked 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
createFoomethod will trig a new WKT parsing. For caching, this factory should be wrapped in some buffered factory likeBufferedAuthorityFactory.- 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
Constructors Constructor Description PropertyCoordinateOperationAuthorityFactory(ReferencingFactoryContainer factories, Citation authority, URL definitions)Creates a factory for the specified authority from the specified file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateOperationcreateCoordinateOperation(String code)Creates an operation from a single operation code.Set<CoordinateOperation>createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)Creates aCoordinateOperationfrom coordinate reference system codes.CitationgetAuthority()Returns the organization or party responsible for definition and maintenance of the database.Set<String>getAuthorityCodes(Class<? extends IdentifiedObject> type)Returns the set of authority codes of the given type.InternationalStringgetDescriptionText(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 Detail
-
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 Detail
-
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates an operation from a single operation code.- Specified by:
createCoordinateOperationin interfaceCoordinateOperationAuthorityFactory- Overrides:
createCoordinateOperationin classAbstractAuthorityFactory- Parameters:
code- Coded value for operation.- Returns:
- The operation for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas 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 aCoordinateOperationfrom 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:
createFromCoordinateReferenceSystemCodesin interfaceCoordinateOperationAuthorityFactory- Overrides:
createFromCoordinateReferenceSystemCodesin classAbstractAuthorityFactory- Parameters:
sourceCRS- Coded value of source coordinate reference system.targetCRS- Coded value of target coordinate reference system.- Returns:
- The operation from
sourceCRStotargetCRS(one single element). - Throws:
NoSuchAuthorityCodeException- if a specified code was not found.FactoryException- if the object creation failed for some other reason.
-
getAuthorityCodes
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type)
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:
getAuthorityCodesin 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:
getDescriptionTextin interfaceAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- A description of the object, or
nullif the object corresponding to the specifiedcodehas no description. - Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the query failed for some other reason.
-
getAuthority
public Citation getAuthority()
Returns the organization or party responsible for definition and maintenance of the database.- Specified by:
getAuthorityin interfaceAuthorityFactory- Specified by:
getAuthorityin classAbstractAuthorityFactory- Returns:
- The organization reponsible for definition of the database.
-
-