org.geotools.referencing.factory
Class PropertyCoordinateOperationAuthorityFactory

Object
  extended by AbstractFactory
      extended by ReferencingFactory
          extended by AbstractAuthorityFactory
              extended by DirectAuthorityFactory
                  extended by PropertyCoordinateOperationAuthorityFactory
All Implemented Interfaces:
RegisterableService, Factory, AuthorityFactory, CoordinateOperationAuthorityFactory

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
PropertyCoordinateOperationAuthorityFactory(ReferencingFactoryContainer factories, Citation authority, URL definitions)
          Creates a factory for the specified authority from the specified file.
 
Method Summary
 CoordinateOperation createCoordinateOperation(String code)
          Creates an operation from a single operation code.
 Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
          Creates a CoordinateOperation from coordinate reference system codes.
 Citation getAuthority()
          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.
 InternationalString 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 class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface AuthorityFactory
createObject
 
Methods inherited from interface Factory
getVendor
 

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:
createCoordinateOperation in interface CoordinateOperationAuthorityFactory
Overrides:
createCoordinateOperation in class AbstractAuthorityFactory
Parameters:
code - Coded value for operation.
Returns:
The operation for the given code.
Throws:
NoSuchAuthorityCodeException - if the specified code 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 a CoordinateOperation 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 interface CoordinateOperationAuthorityFactory
Overrides:
createFromCoordinateReferenceSystemCodes in class AbstractAuthorityFactory
Parameters:
sourceCRS - Coded value of source coordinate reference system.
targetCRS - Coded value of target coordinate reference system.
Returns:
The operation from sourceCRS to targetCRS (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:
getAuthorityCodes in interface AuthorityFactory
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 interface AuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
A description of the object, or null if the object corresponding to the specified code has no description.
Throws:
NoSuchAuthorityCodeException - if the specified code was 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:
getAuthority in interface AuthorityFactory
Specified by:
getAuthority in class AbstractAuthorityFactory
Returns:
The organization reponsible for definition of the database.


Copyright © 1996-2014 Geotools. All Rights Reserved.