Closed JesseCrocker closed 7 years ago
Confirmed against master
. Interestingly, importing Rasterio instead of Fiona produces the same result.
After some additional debugging, I've found the cause of this, setting os.environ['PROJ_LIB']
to a non existing directory at https://github.com/Toblerity/Fiona/blob/master/fiona/_drivers.pyx#L120
And the workaround is to set PROJ_LIB to a valid value(usually /usr/local/share/proj/) before importing fiona.
Maybe a better title for this issue would be "importing fiona cause PROJ_LIB environment variable to be set to a non-existing directory", but maybe im not understanding the cause correctly, so not renaming yet
Expected behavior and actual behavior.
Calling
subprocess.call("gdalwarp -t_srs")
to warp a file from nad27 based projection to a wgs84 based projection doesn't properly do the datum grid shifting after callingimport fiona
.It seems like
import
ing fiona is doing something to env that is causing gdalwarp to fail to load the proj grid shift files.Steps to reproduce the problem.
https://gist.github.com/JesseCrocker/d43016ca0b66ba8824da9254758ab048
Test file that goes with the script https://www.dropbox.com/s/bc1klyb73ep074r/source.tiff?dl=0
post-import.tiff file overlayed on pre-import.tiff file with 50% opacity showing the shift.
Projection info for source
projection info in the same for both result files
Output from test case with
--debug on
added to gdal_warp callOperating system
Tried on macOS 10.12.4 and ubuntu 16.04
Fiona version and provenance
Testing on macOS was with fiona version
'1.7.1.post1'
and 1.7.5 installed from pip,Fiona-1.7.5-cp27-cp27m-macosx_10_6_intel.whl