[gdal-dev] Best way to package and distribute GDAL data files

Emmanuel d'Angelo emmanuel.dangelo at pix4d.com
Tue Feb 14 12:29:08 PST 2017


Ah, thanks a lot! 

I hadn't found this CPLPushFinderLocation function. I could then install the required files in an app-dependant location (so that I don't interfere with user's files if already installed) and set the path during the app initialization. 

I will give it a try and let you know the outcome. 

Thank you!

Emmanuel 
> Le 14 févr. 2017 à 17:22, Ari Jolma <ari.jolma at gmail.com> a écrit :
> 
> Well,
> 
> In your code you can manage the location where GDAL looks for the files with CPLPushFinderLocation.
> 
> In my case I have Perl modules, which depend on the GDAL Perl module. In a test scenario for the first module it needs to ask installation of the GDAL Perl module, which needs to ask for GDAL itself to be installed. Then GDAL is really private to the GDAL Perl module and the GDAL files are not easy to find by downstream modules. I manage it so that the GDAL Perl module installs the GDAL data files in a shared directory, whose name downstream modules can find out by a known method (Perl module called File::ShareDir). The module then pushes this to the GDAL finder, and so GDAL can find its data files.
> 
> This is perhaps one code layer more than in your application but anyway you need to arrange it so that the your installer stores the name of the GDAL data directory somewhere it can find it in runtime.
> 
> Hope this helps,
> Ari
> 
> 14.02.2017, 17:12, Emmanuel d'Angelo kirjoitti:
>> Thanks Ari for the interest!
>> 
>> Unfortunately, my target is to ship for all 3 major OSes (linux, windows, macOS).
>> Regarding my build system, everything is glued by cmake. Not sure if it's related, but I build (for now) GDAL as a dynamic lib and PROJ4 as a static one. Any change here is possible if it helps with the issue. 
>> 
>> Emmanuel 
>> 
>> Le 14 févr. 2017 à 15:52, Ari Jolma <ari.jolma at gmail.com> a écrit :
>> 
>>> Emmanuel,
>>> 
>>> I think we need to know the OS you're using.
>>> 
>>> Ari
>>> 
>>> 14.02.2017, 16:48, Emmanuel d'Angelo kirjoitti:
>>>> Dear list,
>>>> 
>>>> I'm trying to package and distribute an application that relies internally on GDAL for some raster / vector manipulation. 
>>>> 
>>>> It may happen in some cases that a user of the application wants to take her outputs to a different coordinate system (typically from some national system to WGS84). As far as I can see, some of these transformations rely on the content of GDAL data files (such as pcs.csv or datum.csv).
>>>> 
>>>> I can install these files locally and use the GDAL_DATA environment variable to find them from my application. However, on the user side, what's the recommended practice? 
>>>> Do I need to ensure that my users have a GDAL_DATA variable set too with the correct data files? I've looked at the build system files, but I couldn't find a way to set this path relative to my application (which would let me install these files inside the app package and distribute them with the application).
>>>> 
>>>> Any hint to put me on the right track would be greatly appreciated.
>>>> 
>>>> Best regards,
>>>> 
>>>> Emmanuel
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> gdal-dev mailing list
>>>> gdal-dev at lists.osgeo.org
>>>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>>> 
>>> _______________________________________________
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170214/1a5b7dff/attachment.html>


More information about the gdal-dev mailing list