Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-393

Missing META-INF service declarations for authority factories

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.7, 0.8
    • Fix Version/s: 1.1
    • Component/s: Referencing
    • Labels:
      None

      Description

      The core/sis-referencing/src/main/resources/META-INF/services/ directory registers a CRSAuthorityFactory, but not yet any CSAuthorityFactory, DatumAuthorityFactory or CoordinateOperationAuthorityFactory. The later in particular would be useful for an easier access to the following method:

      Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
      

      The reason why authority factories other than CRSAuthorityFactory are not yet registered is because it is more convenient for Apache SIS to use a single instance for all kind of authority factories (for sharing the cache). This can be done more cleanly in Java 9 using the new ServiceLoader capability. In the meantime, users can get the factory with following code, which is unsafe, but should work at least with SIS 0.8:

      CoordinateOperationAuthorityFactory factory = (CoordinateOperationAuthorityFactory) CRS.getAuthorityFactory("EPSG");
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                desruisseaux Martin Desruisseaux
                Reporter:
                desruisseaux Martin Desruisseaux
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: