[Proj] Search directory for grid shift files

Frank Warmerdam warmerdam at pobox.com
Thu Nov 7 10:27:37 EST 2013


Marco,

PROJ is not really setup to make this available, and it is complicated by
the fact that there are several search rules.  With PROJ 4.8 you could sort
of accomplish this by setting a custom file open function on the context
and then seeing where gets probed for but that is ugly and it is hard to
know which of the probe locations is ideal.  It also would only work for
this very recent version.

In some situations the PROJ_LIB environment variable may be set, and you
could use that.

Just checking for the "usual places" such as /usr/share/proj or
/usr/local/share/proj on unix systems might go quite a long ways.

One suggestion, in the QGIS context might be that you keep them in some
sort of QGIS subtree, and use pj_set_searchpath() to check there.  The
downside of this approach is that other applications on the systems
(including things run as subprocesses of QGIS) won't see the files.

Best regards,
Frank



On Thu, Nov 7, 2013 at 1:55 AM, Marco Hugentobler <
marco.hugentobler at sourcepole.ch> wrote:

>  Hi
>
> I'm trying to implement support for datum transformations with grid shift
> files into the QGIS gui. For better useability, I would like to check if a
> shift file for a datum transformation is present (and if not, give a hint
> to the user where to put the .gsb file).
> Is there a way to find out the search directory for grid shift files? I
> see in the API doc there is a method pj_set_searchpath, however I cannot
> find one to read the path. What is the best approach to get the search path?
>
>
> Thank you for any hint,
> Marco
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20131107/e99e5c83/attachment.htm 


More information about the Proj mailing list