<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr">On Wed, Jan 9, 2019 at 11:12 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> PROJ 6 new API has a proj_context_set_database_path() function but I've not<br>
> used/exposed through GDAL for now. It is something per-context (and thus<br>
> potentially per thread since in my new GDAL branch PROJ contexts are per-<br>
> thread variables, which are not exposed in GDAL API), and only for proj.db<br>
> itself, not other PROJ resources (such as grid files) normally accessible<br>
> through PROJ_LIB / ${prefix}/share/proj<br>
> <br>
> There's also a related ticket in PROJ tracker:<br>
> <a href="https://github.com/OSGeo/proj.4/issues/1150" rel="noreferrer" target="_blank">https://github.com/OSGeo/proj.4/issues/1150</a><br>
> We'd probably need to expose pj_set_searchpath() in the public PROJ API.<br>
<br>
I've just submitted a PR <a href="https://github.com/OSGeo/proj.4/pull/1218" rel="noreferrer" target="_blank">https://github.com/OSGeo/proj.4/pull/1218</a> to add a<br>
<br>
proj_context_set_search_paths(<br>
 PJ_CONTEXT *ctx, int count_paths,const char* const* paths)<br>
<br>
If called on the default PROJ context (NULL) before GDAL creates it own <br>
contexts, this should allow you to specify your own search path.<br></blockquote><div><br></div><div>Or I could call pj_set_searchpath?</div><div><br></div><div>I'm a little concerned about the need to race GDAL to the default context. I'm not sure how I'll be able to do this in practice. Even if Rasterio were to call pj_set_searchpath immediately on import, which I'd like to avoid for a number of reasons, any user who imported a different module that loads GDAL (osgeo.gdal, for example) before importing Rasterio would lose that insurance and may experience some trouble that is hard to diagnose. Could a GDAL API function that allowed modification of the search path in GDAL's own context help? </div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div>