Hello
There is different possible approaches. A first one is to get the list
of all possible operations between a given pair of CRS and pickup the
one you prefer. The static methods in the CRS class are actually just
convenience methods; they don't do much more than delegating to one of
the various factories. To gain more control, the following code may be
tried:
CoordinateOperationAuthorityFactory opFactory = (CoordinateOperationAuthorityFactory)
CRS.getAuthorityFactory("EPSG");
Set<CoordinateOperation> operations =
opFactory.createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
If you know the EPSG code of the desired coordinate operation, you can
also invoke createCoordinateOperation(String) directly.
It is also possible to get the set of CoordinateOperation for a pair of
CRS instead than a pair of EPSG codes, and finally it is also possible
to construct a coordinate operation by providing the parameter values
(without EPSG database). Let me know if one of the latest approaches is
the desired ones.
Martin
Le 16/12/2019 à 16:30, Thierry Danard a écrit :
It's quite common in geoscience to pick not the just the CRS that a
dataset uses, but also to pick at the same time the matching transform
to WGS 84.
For example, when a user picks the 32056 - NAD 27 / Wyoming East
Central CRS, the EPSG database has several possible transformations to
WGS 84. One of them is 1173 - NAD27 to WGS 84 (4) USA - CONUS - onshore.
I couldn't find a way to pass this transform to the CRS.findOperation
method. I do understand that:
- this transform is often not needed, as better methods than using WGS
84 as a hub can be used (NADCON, NTV2, HARN, etc) in many areas
- passing the bounding box technically allows Apache SIS to pick the
best transform for that bounding box
However, in many geoscience applications, the user wants to "pick"
this transform to WGS 84 themselves, and use WGS 84 as transformation
hub if no other method is available.
Does Apache SIS support transforms to WGS 84? Is there a way I can
specify a transform to WGS 84 when I find an operation, especially
outside of an NADCON/NTV2/HARN area?
-Thierry