[PROJ] Reversing a coordinate operation via proj api

Even Rouault even.rouault at spatialys.com
Thu Dec 12 15:55:13 PST 2019


Hi Nyall,

> If I have a proj string representing a coordinate operation, is there
> any existing proj c api to reverse this operation?

Do you mean, to get a PROJ string corresponding to the reverse operation ? 
Then, no. Although that would not be too complicated: separate the steps, 
reverse their order, for each step add +inv (or remove +inv if already 
present), and reconcatenate them.
(with PROJ master, you'd need also to change +omit_fwd to +omit_inv and 
+omit_inv to +omit_fwd)

If you just want to apply the reverse operation on coordinates, you can call 
proj_trans()/proj_trans_array()/etc. with direction = PJ_INV instead of PJ_FWD

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list