Class PropertyCoordinateOperationFactory
- Object
-
- AbstractFactory
-
- ReferencingFactory
-
- AbstractCoordinateOperationFactory
-
- DefaultCoordinateOperationFactory
-
- PropertyCoordinateOperationFactory
-
- All Implemented Interfaces:
Factory,ObjectFactory,CoordinateOperationFactory,Factory,RegistrableFactory
public abstract class PropertyCoordinateOperationFactory extends DefaultCoordinateOperationFactory
ACoordinateOperationAuthorityFactorybacked by a properties file. It's similar toPropertyCoordinateOperationAuthorityFactorybut allows custom transform definitions across CRSs in different authorities. The CRSs are still expressed as WKT math transforms. Entries in the properties file take this format:[source crs code],[target crs code]=[WKT math transform]
Examples:EPSG:4230,EPSG:4258=PARAM_MT["NTv2", PARAMETER["Latitude and longitude difference file", "100800401.gsb"]]
For more compact definitions, parameter names can be replaced by their corresponding EPSG codes. Following examples are the same as former ones:EPSG:4230,EPSG:4258=PARAM_MT["9615", PARAMETER["8656", "100800401.gsb"]]
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 DefaultCoordinateOperationFactory
PIVOT_CRS_LIST_KEY
-
Fields inherited from class AbstractCoordinateOperationFactory
AXIS_CHANGES, DATUM_SHIFT, ELLIPSOID_SHIFT, GEOCENTRIC_CONVERSION, IDENTITY, INVERSE_OPERATION
-
Fields inherited from class ReferencingFactory
LOGGER
-
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
-
Constructor Summary
Constructors Constructor Description PropertyCoordinateOperationFactory(Hints userHints, int priority)Creates a factory for the specified authority from the specified file.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Set<CoordinateOperation>findFromDatabase(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, int limit)Returns a list of available coordinate operations explicitly defined in some database (typically EPSG), for the provided CRS pair.protected PropertiesgetDefinitions()Loads definitions from the specified input stream.protected abstract URLgetDefinitionsURL()-
Methods inherited from class DefaultCoordinateOperationFactory
createFromDatabase, createOperation, createOperation, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, findOperations, findOperations, findOperationSteps, findOperationSteps, findOperationSteps, findOperationSteps, findOperationSteps, findOperationSteps, tryWellKnownPivots
-
Methods inherited from class AbstractCoordinateOperationFactory
concatenate, concatenate, concatenate, concatenate, createConcatenatedOperation, createDefiningConversion, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, ensureNonNull, getErrorMessage, getImplementationHints, getMathTransformFactory, inverse, swapAndScaleAxis
-
Methods inherited from class ReferencingFactory
getVendor
-
Methods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
-
-
-
-
Constructor Detail
-
PropertyCoordinateOperationFactory
public PropertyCoordinateOperationFactory(Hints userHints, int priority)
Creates a factory for the specified authority from the specified file.- Throws:
IOException- if the definitions can't be read.
-
-
Method Detail
-
getDefinitions
protected Properties getDefinitions()
Loads definitions from the specified input stream. The stream is closed by this method.- Throws:
IOException- if the definitions can't be read.
-
findFromDatabase
public Set<CoordinateOperation> findFromDatabase(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, int limit)
Description copied from class:DefaultCoordinateOperationFactoryReturns a list of available coordinate operations explicitly defined in some database (typically EPSG), for the provided CRS pair. Otherwise (if there is no database, or if the database doesn't contains any explicit operation fromsourceCRStotargetCRS, or if this method failed to create the operations from the database), returns an emptySet.The default implementation always returns an empty
Set, since there is no database connected to aDefaultCoordinateOperationFactoryinstance. In other words, the default implementation is "standalone": it tries to figure out transformation paths by itself. Subclasses should override this method if they can fetch a more accurate operation from some database. The mean subclass doing so isAuthorityBackedFactory.This method is invoked by
findOperations(sourceCRS, targetCRS)before to try to figure out a transformation path by itself. It is also invoked by variousfindOperationSteps(...)methods when an intermediate CRS was obtained byGeneralDerivedCRS.getBaseCRS()(this case occurs especially during geographic from/to projected CRS operations). This method is not invoked for synthetic CRS generated bycreateOperationStep(...), since those temporary CRS are not expected to exist in a database.- Specified by:
findFromDatabasein interfaceCoordinateOperationFactory- Overrides:
findFromDatabasein classDefaultCoordinateOperationFactory- Parameters:
sourceCRS- Input coordinate reference system.targetCRS- Output coordinate reference system.limit- The maximum number of operations to be returned. Use -1 to return all the available operations. Use 1 to return just one operations. Currently, the behavior for other values oflimitis undefined.- Returns:
- A set of coordinate operations from
sourceCRStotargetCRSif and only if one is explicitly defined in some underlying database, or an emptySetotherwise.
-
getDefinitionsURL
protected abstract URL getDefinitionsURL()
-
-