Class CoordinateOperationSet

java.lang.Object
java.util.AbstractCollection<org.opengis.referencing.operation.CoordinateOperation>
java.util.AbstractSet<org.opengis.referencing.operation.CoordinateOperation>
org.apache.sis.referencing.factory.IdentifiedObjectSet<org.opengis.referencing.operation.CoordinateOperation>
org.apache.sis.referencing.factory.sql.CoordinateOperationSet
All Implemented Interfaces:
Iterable<org.opengis.referencing.operation.CoordinateOperation>, Collection<org.opengis.referencing.operation.CoordinateOperation>, Set<org.opengis.referencing.operation.CoordinateOperation>, CheckedContainer<org.opengis.referencing.operation.CoordinateOperation>, Localized

final class CoordinateOperationSet extends IdentifiedObjectSet<org.opengis.referencing.operation.CoordinateOperation>
A lazy set of CoordinateOperation objects to be returned by the EPSGDataAccess.createFromCoordinateReferenceSystemCodes(String, String) method. There is two different ways in which EPSGDataAccess get coordinate operations:
  1. The coordinate operation may be the conversion from base property of a projected CRS. Those conversions are obtained by a SQL query like below (note that this query can return at most one result, because COORD_REF_SYS_CODE is a primary key):
  2. The coordinate operation may be standalone. This is the case of coordinate transformations having stochastic errors. Those transformations are obtained by a SQL query like below (note that this query can return many results):
We distinguish those two cases by the presence or absence of a coordinate operation code in the projections map.
Since:
0.7
Version:
0.8
  • Field Details

    • projections

      private final Map<String,Integer> projections
      The codes of ProjectedCRS objects for the specified Conversion codes.
      • Keys a coordinate operation codes.
      • Values are coordinate reference system codes. They are usually ProjectedCRS, but the EPSG database sometimes use this mechanisms for other kind of CRS.
      This map does not contain all operations to be returned by this CoordinateOperationSet, but only the ones to be returned by the first SQL query documented in the class Javadoc.
  • Constructor Details

    • CoordinateOperationSet

      CoordinateOperationSet(org.opengis.referencing.AuthorityFactory factory)
      Creates a new instance of this lazy set.
  • Method Details

    • addAuthorityCode

      final void addAuthorityCode(String code, Integer crs)
      Adds the specified authority code.
      Parameters:
      code - the code for the CoordinateOperation to add.
      crs - the code for the CRS to create instead of the operation, or null if none.
    • getAuthorityCode

      protected String getAuthorityCode(org.opengis.referencing.operation.CoordinateOperation object)
      Same as the default implementation in parent class, but avoid to call the costly EPSGDataAccess.getAuthority() method.
      Overrides:
      getAuthorityCode in class IdentifiedObjectSet<org.opengis.referencing.operation.CoordinateOperation>
      Parameters:
      object - the object for which to get the authority code.
      Returns:
      the authority code of the given identified object.
    • createObject

      protected org.opengis.referencing.operation.CoordinateOperation createObject(String code) throws org.opengis.util.FactoryException
      Creates a coordinate operation for the specified EPSG code.
      Overrides:
      createObject in class IdentifiedObjectSet<org.opengis.referencing.operation.CoordinateOperation>
      Parameters:
      code - the code for which to create the identified object.
      Returns:
      the identified object created from the given code.
      Throws:
      org.opengis.util.FactoryException - if the object creation failed.