Hi,

I am evaluating using SIS as the basis for our CRS management libraries on
gvSIG project (a desktop, Java-based GIS application).

I am checking we can implement all our use-cases, but I am finding some
limitations regarding selection of CRS transform operations.

Currently, we offer the user the opportunity to choose the transformation
method when transforming coordinates from a source CRS to a target CRS
involving different datums (for instance from EPSG:23030 to EPSG:4326).

However, I don't find a clear way to get this information from SIS API.
Ideally, I would expect a method like:
Set<CoordinateOperation> ops = CRS.findOperations(source, target, context);
but it obviously doesn't exist at the moment.

I have achieved a similar goal by diving a bit in the implementation and
subclassing CoordinateOperationFinder and DefaultCoordinateOperationFactory
:

[...]
Set<CoordinateOperation> operations =
((CoordinateOperationAuthorityFactory)
registry).createFromCoordinateReferenceSystemCodes("4230", "4326");
Set<CoordinateOperation> operations =
((CoordinateOperationAuthorityFactory) CustomCoordinateOperationFinder
finder = new
CustomCoordinateOperationFinder((CoordinateOperationAuthorityFactory)
registry,
                (CoordinateOperationFactory) auxFactory, null);
CoordinateOperation concatenatedOps = finder.createOperationStep(source,
(SingleCRS)target, selectedOp);

This approach is clearly a bad idea, since:
- those classes have been designed to not being subclassed (declaring a lot
of private or "friendly" methods) and I assume my implementation would be
very sensitive to SIS version updates
- we loose the heuristics internally used by SIS to use the right
concatenation pipeline (in the example: EPSG:23030 to EPSG:4230, then
EPSG:4326). Which means that we would need to replicate those heuristics in
our library to take into account all the different scenarios, as it is
currently done by SIS internally.
- it seems to fail if CRS.findOperation has been previously called (I
assume that caused by transformation caching for those CRS pairs)

However, I believe that CRS.findOperations would not be extremely hard to
implement if done within Apache SIS library (instead of doing it
externally). Do you think it would be feasible? Would you be keen on
accepting such contribution?

Thanks in advance,

César Martínez Izquierdo




-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   César Martínez Izquierdo
   GIS developer
   -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
   SCOLAB: http://www.scolab.es
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Reply via email to