Hello Thierry
Le 16/12/2019 à 22:26, Thierry Danard a écrit :
(...snip...) The set returned does contain many eligible operations,
and one of them is transform 1311, the one I want to use.
CoordinateOperation["ED50 to WGS 84 (18)",
(...snip...),
Id["EPSG", *1311*, "9.7",
URI["urn:ogc:def:coordinateOperation:EPSG:9.7:1311"]]]
(...snip...) Is there an API that would give me direct access to this
transform id?
Yes. Most objects (CoordinateOperation, CoordinateReferenceSystem, etc.)
have a getIdentifiers() method. So one can write:
for (Identifier id : coordinateOperation.getIdentifiers()) {
String code = id.getCode();
if (code.equals("theDesiredCode") {
// Found it.
}
}
Alternatively the following class provides some static convenience
methods that may be useful:
http://sis.apache.org/apidocs/org/apache/sis/referencing/IdentifiedObjects.html
As another alternative, if you know in advance the EPSG code of the
desired coordinate operation, you can write directly:
CoordinateOperationAuthorityFactory opFactory = (CoordinateOperationAuthorityFactory)
CRS.getAuthorityFactory("EPSG");
CoordinateOperation operation = opFactory.createCoordinateOperation("1311");
Martin