Class PropertyCoordinateOperationFactory

All Implemented Interfaces:
Factory, ObjectFactory, CoordinateOperationFactory, Factory, RegistrableFactory

public abstract class PropertyCoordinateOperationFactory extends DefaultCoordinateOperationFactory
A CoordinateOperationAuthorityFactory backed by a properties file. It's similar to PropertyCoordinateOperationAuthorityFactory but 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 createFoo method will trig a new WKT parsing. For caching, this factory should be wrapped in some buffered factory like BufferedAuthorityFactory.

Author:
Oscar Fonts
  • Constructor Details

    • 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 Details

    • 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: DefaultCoordinateOperationFactory
      Returns 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 from sourceCRS to targetCRS, or if this method failed to create the operations from the database), returns an empty Set.

      The default implementation always returns an empty Set, since there is no database connected to a DefaultCoordinateOperationFactory instance. 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 is AuthorityBackedFactory.

      This method is invoked by findOperations(sourceCRS, targetCRS) before to try to figure out a transformation path by itself. It is also invoked by various findOperationSteps(...) methods when an intermediate CRS was obtained by GeneralDerivedCRS.getBaseCRS() (this case occurs especially during geographic from/to projected CRS operations). This method is not invoked for synthetic CRS generated by createOperationStep(...), since those temporary CRS are not expected to exist in a database.

      Specified by:
      findFromDatabase in interface CoordinateOperationFactory
      Overrides:
      findFromDatabase in class DefaultCoordinateOperationFactory
      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 of limit is undefined.
      Returns:
      A set of coordinate operations from sourceCRS to targetCRS if and only if one is explicitly defined in some underlying database, or an empty Set otherwise.
    • getDefinitionsURL

      protected abstract URL getDefinitionsURL()