Sorry for bothering you so much but we are a bit stuck on this last part.
Here is a description of what we are trying to do:
------
// input data is in EPSG:26716 (NAD27 / UTM zone 16N)
double x = 250072.891031813;
double y = 4147221.68033625;
// we want to use explicitly EPSG:1175 (NAD27 to WGS 84 (6) ) for
the datum transformation part
?????
//what we are trying to calculate
double wgs84Latitude;
double wgs84Longitude;
------
Of course we have figured out how to do it with the default TOWGS transform
but not with the one we want (1175)
On Mon, Dec 16, 2019 at 3:47 PM Martin Desruisseaux <
[email protected]> wrote:
> 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
>
>