[Proj] Search directory for grid shift files

Marco Hugentobler marco.hugentobler at sourcepole.ch
Thu Nov 7 08:22:08 PST 2013


Hi Frank

Thank you for the advice. The PROJ_LIB variable seems to be set at least 
on windows, so that's already a good thing to check.

 >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

Does the pj_set_searchpath add an additional search path or does it also 
override the default path? If it adds, having a dedicated subdirectory 
sounds good.

Regards,
Marco

On 07.11.2013 16:27, Frank Warmerdam wrote:
> 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 
> <mailto: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 <mailto: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 <mailto:warmerdam at pobox.com>
> light and sound - activate the windows | http://pobox.com/~warmerdam 
> <http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush    | Geospatial Software Developer
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee

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


More information about the Proj mailing list