sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SIS-393) Missing META-INF service declarations for authority factories
Date Wed, 31 Jan 2018 18:12:00 GMT

     [ https://issues.apache.org/jira/browse/SIS-393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Desruisseaux updated SIS-393:
------------------------------------
    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:

{code:java}
Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
{code}

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:

{code:java}
CoordinateOperationAuthorityFactory factory = (CoordinateOperationAuthorityFactory) CRS.getAuthorityFactory("EPSG");
{code}


  was:
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:

{code:java}
Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
{code}

This task can be done more cleanly in Java 9 using the new {{ServiceLoader}} capability,
but workaround are possible in Java 8 too. In the meantime, users can get the factory with
following code. This is unsafe, but should work at least with SIS 0.8:

{code:java}
CoordinateOperationAuthorityFactory factory = (CoordinateOperationAuthorityFactory) CRS.getAuthorityFactory("EPSG");
{code}



> Missing META-INF service declarations for authority factories
> -------------------------------------------------------------
>
>                 Key: SIS-393
>                 URL: https://issues.apache.org/jira/browse/SIS-393
>             Project: Spatial Information Systems
>          Issue Type: Task
>          Components: Referencing
>    Affects Versions: 0.7, 0.8
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>            Priority: Major
>             Fix For: 1.0
>
>
> 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:
> {code:java}
> Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
> {code}
> 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:
> {code:java}
> CoordinateOperationAuthorityFactory factory = (CoordinateOperationAuthorityFactory) CRS.getAuthorityFactory("EPSG");
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message