Class CoordinateOperationFactoryUsingWKT
- All Implemented Interfaces:
AuthorityFactory,Factory,CoordinateOperationAuthorityFactory,BufferedFactory,Factory,OptionalFactory,RegistrableFactory
This factory can be used as a replacement for Coordinate Operations when there is no access to a complete EPSG database. Or can be used to override the coordinate operations defined in EPSG if assigned a higher priority.
The Coordinate Operations are defined as Well Known Text math transforms (see
PropertyCoordinateOperationAuthorityFactory for format specification and examples).
Property file name is "epsg_operations.properties", and its possible locations are described here. If no property file is found, the factory won't be activated.
If an operation is not found in the properties file, this factory will delegate creation on a fallback factory.
The fallback factory is the next registered CoordinateOperationAuthorityFactory after this one in the
priority chain.
- Author:
- Oscar Fonts
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CitationThe authority.protected final StringDirectory scanned for extra definitions.protected final ReferencingFactoryContainerThe factories to be given to the backing store.protected CoordinateOperationAuthorityFactoryAn alternate factory to be used when the primary one doesn't find an operationprotected booleanJust a flag not to search more than oncestatic final StringThe default filename to read.static final intPriority for this factoryFields inherited from class ReferencingFactory
LOGGERFields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an authority factory using the default set of factories.CoordinateOperationFactoryUsingWKT(Hints userHints) Constructs an authority factory using a set of factories created from the specified hints.CoordinateOperationFactoryUsingWKT(Hints userHints, int priority) Constructs an authority factory using the specified hints and priority. -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractAuthorityFactoryCreates the backing store authority factory.Creates an operation from a single operation code.createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) Creates operations from coordinate reference system codes.Returns the organization or party responsible for definition and maintenance of the underlying database.protected URLReturns the URL to the property file that contains Operation definitions.protected CoordinateOperationAuthorityFactoryGets the next availableCoordinateOperationAuthorityFactoryin the priority list.Methods inherited from class DeferredAuthorityFactory
canDisposeBackingStore, dispose, disposeBackingStore, exit, getBackingStore, isAvailable, isConnected, setTimeoutMethods inherited from class BufferedAuthorityFactory
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, getAuthorityCodes, getBackingStoreDescription, getDescriptionText, getIdentifiedObjectFinder, getVendorMethods inherited from class AbstractAuthorityFactory
noSuchAuthorityCode, trimAuthorityMethods inherited from class ReferencingFactory
ensureNonNullMethods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toStringMethods inherited from interface AuthorityFactory
createObject, getAuthorityCodes, getDescriptionTextMethods inherited from interface Factory
getImplementationHints
-
Field Details
-
authority
The authority. Will be created only when first needed.- See Also:
-
FILENAME
The default filename to read. The defaultFactoryUsingWKTimplementation will search for the first occurence of this file in the following places:- In the directory specified by the "org.geotools.referencing.crs-directory" system property.
- In every
org/geotools/referencing/factory/espgdirectories found on the classpath.
- See Also:
-
PRIORITY
public static final int PRIORITYPriority for this factory- See Also:
-
factories
The factories to be given to the backing store. -
directory
Directory scanned for extra definitions. -
fallbackAuthorityFactory
An alternate factory to be used when the primary one doesn't find an operation -
fallbackAuthorityFactorySearched
protected boolean fallbackAuthorityFactorySearchedJust a flag not to search more than once
-
-
Constructor Details
-
CoordinateOperationFactoryUsingWKT
public CoordinateOperationFactoryUsingWKT()Constructs an authority factory using the default set of factories. -
CoordinateOperationFactoryUsingWKT
Constructs an authority factory using a set of factories created from the specified hints. -
CoordinateOperationFactoryUsingWKT
Constructs an authority factory using the specified hints and priority.
-
-
Method Details
-
getAuthority
Description copied from class:BufferedAuthorityFactoryReturns the organization or party responsible for definition and maintenance of the underlying database.- Specified by:
getAuthorityin interfaceAuthorityFactory- Overrides:
getAuthorityin classBufferedAuthorityFactory- Returns:
- The organization reponsible for definition of the database.
-
createBackingStore
Creates the backing store authority factory.- Specified by:
createBackingStorein classDeferredAuthorityFactory- Returns:
- The backing store to uses in
createXXX(...)methods. - Throws:
FactoryNotFoundException- if thepropertiesfile has not been found.FactoryException- if the constructor failed to find or read the file. This exception usually has anIOExceptionas its cause.
-
getDefinitionsURL
Returns the URL to the property file that contains Operation definitions. The default implementation performs the following search path:- If a value is set for the "org.geotools.referencing.crs-directory" system property key, then the "epsg_operations.properties" file will be searched in this directory.
- If no value is set for the above-cited system property, or if no "epsg_operations.properties" file was found in that
directory, then the first "epsg_operations.properties" file found in any
org/geotools/referencing/factory/epsgdirectory on the classpath will be used. - If no file was found on the classpath neither, then this factory will be disabled.
- Returns:
- The URL, or
nullif none.
-
createFromCoordinateReferenceSystemCodes
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws NoSuchAuthorityCodeException, FactoryException Creates operations from coordinate reference system codes.This method searches in the properties file for operations.
If not found there, it will create operations from a fallback factory (see
getFallbackAuthorityFactory()).- Specified by:
createFromCoordinateReferenceSystemCodesin interfaceCoordinateOperationAuthorityFactory- Overrides:
createFromCoordinateReferenceSystemCodesin classBufferedAuthorityFactory- Parameters:
sourceCRS- Coded value of source coordinate reference system.targetCRS- Coded value of target coordinate reference system.- Returns:
- The operations from
sourceCRStotargetCRS. - Throws:
NoSuchAuthorityCodeException- if a specified code was not found.FactoryException- if the object creation failed for some other reason.
-
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws NoSuchAuthorityCodeException, FactoryException Creates an operation from a single operation code.This method searches in the properties file for operations.
If not found there, it will create operations from a fallback factory (see
getFallbackAuthorityFactory()).- Specified by:
createCoordinateOperationin interfaceCoordinateOperationAuthorityFactory- Overrides:
createCoordinateOperationin classBufferedAuthorityFactory- Parameters:
code- Coded value for operation.- Returns:
- The operation from
sourceCRStotargetCRS. - Throws:
NoSuchAuthorityCodeException- if a specified code was not found.FactoryException- if the object creation failed for some other reason.
-
getFallbackAuthorityFactory
protected CoordinateOperationAuthorityFactory getFallbackAuthorityFactory() throws NoSuchAuthorityCodeException, FactoryExceptionGets the next availableCoordinateOperationAuthorityFactoryin the priority list.- Returns:
- the alternative CoordinateOperationAuthorityFactory.
- Throws:
NoSuchAuthorityCodeException- if a specified code was not found.FactoryException- if the object creation failed for some other reason.
-