<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 16, 2019, at 12:30 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com" class="">even.rouault@spatialys.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class="">Hum. Right now I’m creating and caching the result of<br class="">proj_create_crs_to_crs(). If I get two PJ from proj_create() is there a way<br class="">to create an “optimum pipeline” ala proj_create_crs_to_crs() using two PJ<br class="">as the start/end points, instead of two strings?<br class=""></blockquote><br class="">2 options:<br class="">- you export your PJ objects as wkt with proj_as_wkt() and feed that to <br class="">proj_create_crs_to_crs()<br class="">- or you emulate most of what proj_create_crs_to_crs() does, which is <br class="">essentially using proj_create_operations() which takes 2 PJ objects (of type <br class="">CRS):<br class=""><a href="https://github.com/OSGeo/proj.4/blob/master/src/4D_api.cpp#L1010" class="">https://github.com/OSGeo/proj.4/blob/master/src/4D_api.cpp#L1010</a><br class=""><br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Or, after the commit I just pushed, you can extract the source CRS from<br class="">the<br class="">pipeline with proj_get_source_crs() (but only if you've created the<br class="">pipeline with proj_create_crs_to_crs(). Not if you created it with<br class="">proj_create("+proj=pipeline ...") )<br class=""></blockquote><br class="">Any chance you could also add proj_get_dest_crs() to pick the CRS off the<br class="">end of a pipeline? <br class=""></blockquote><br class="">Ah, that was implied that my changeset also fixes the dest part of course.<br class=""></div></div></blockquote><div><br class=""></div><div>Ah, I see! I cannot get it to work though, I am trying this:</div><div><br class=""></div><div><a href="https://gist.github.com/pramsey/22127622023e88cd415cd1524db0a285#file-proj-c-L19-L24" class="">https://gist.github.com/pramsey/22127622023e88cd415cd1524db0a285#file-proj-c-L19-L24</a></div><div><br class=""></div><div>And getting:</div><div><br class=""></div><div> proj_get_source_crs: Object is not a BoundCRS or a CoordinateOperation <br class=""> proj_get_target_crs: Object is not a BoundCRS or a CoordinateOperation<br class=""><br class=""></div><div>What’s my mistake?</div><div><br class=""></div><div>P</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">Even<br class=""><br class="">-- <br class="">Spatialys - Geospatial professional services<br class=""><a href="http://www.spatialys.com" class="">http://www.spatialys.com</a><br class=""></div></div></blockquote></div><br class=""></body></html>