[PROJ] Proj6 Docs

Paul Ramsey pramsey at cleverelephant.ca
Sat Feb 16 13:40:27 PST 2019



> On Feb 16, 2019, at 12:30 PM, Even Rouault <even.rouault at spatialys.com> wrote:
> 
>> Hum. Right now I’m creating and caching the result of
>> proj_create_crs_to_crs(). If I get two PJ from proj_create() is there a way
>> to create an “optimum pipeline” ala proj_create_crs_to_crs() using two PJ
>> as the start/end points, instead of two strings?
> 
> 2 options:
> - you export your PJ objects as wkt with proj_as_wkt() and feed that to 
> proj_create_crs_to_crs()
> - or you emulate most of what proj_create_crs_to_crs() does, which is 
> essentially using proj_create_operations() which takes 2 PJ objects (of type 
> CRS):
> https://github.com/OSGeo/proj.4/blob/master/src/4D_api.cpp#L1010
> 
> 
>>> Or, after the commit I just pushed, you can extract the source CRS from
>>> the
>>> pipeline with proj_get_source_crs() (but only if you've created the
>>> pipeline with proj_create_crs_to_crs(). Not if you created it with
>>> proj_create("+proj=pipeline ...") )
>> 
>> Any chance you could also add proj_get_dest_crs() to pick the CRS off the
>> end of a pipeline? 
> 
> Ah, that was implied that my changeset also fixes the dest part of course.

Ah, I see! I cannot get it to work though, I am trying this:

https://gist.github.com/pramsey/22127622023e88cd415cd1524db0a285#file-proj-c-L19-L24 <https://gist.github.com/pramsey/22127622023e88cd415cd1524db0a285#file-proj-c-L19-L24>

And getting:

 proj_get_source_crs: Object is not a BoundCRS or a CoordinateOperation 
 proj_get_target_crs: Object is not a BoundCRS or a CoordinateOperation

What’s my mistake?

P

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20190216/afcdc4c7/attachment.html>


More information about the PROJ mailing list