[gdal-dev] Discoverability of the new proj.db and GDAL_DATA/PROJ_LIB?

Sean Gillies sean at mapbox.com
Tue Jan 8 14:16:47 PST 2019


Hi,

I have a couple questions about discoverability of the new proj.db file and
how I should prepare my Rasterio project for the changes. Background: I am
publishing rasterio wheels on the Python package index that include GDAL
and PROJ shared libraries and the data files so that users can `pip install
rasterio` and get something with batteries included. Rasterio has an Env
class that is to be used as a context manager and it ensures that PROJ_LIB
(the env variable) and GDAL_DATA (the config option, not env variable) are
set to the proper paths, paths within the installed wheel adjacent to
rasterio's Python modules.

It seems like I'll be including proj.db in future wheels, which shouldn't
be a problem.

When proj.db replaces the .csv files in GDAL and PROJ, will the GDAL_DATA
configuration option become obsolete? If so, will there be different
configuration option to point at the proj.db file? I'd prefer not to use an
environment variable only, as far as I'm concerned a Python module should
only patch the environment as a very last recourse.

I've just thought of a question about data file caching that I want to tack
on. I don't think it's widely understood by users, but GDAL caches data
read from the .csv files. For example, you can set GDAL_DATA to a custom
location (like rasterio does), call a function that requires .csv data,
then return and call that function again with GDAL_DATA unset and get the
right answer. This is a good thing, because otherwise we'd be reading from
disk every time. My question is whether or not this will change when we
move over to the new PROJ. Will data be cached or will we need the path to
proj.db to be configured all the time?

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190108/d1b9beb3/attachment.html>


More information about the gdal-dev mailing list