I try to reproject a raster using gdalwarp.
To do so I use the subprocess package of Python3 :
command = [
'gdalwarp',
map_raster,
map_raster_proj,
'-t_srs', 'ESRI:54009'
]
print(' '.join(command))
kwargs = {
'args' : command,
'cwd' : os.path.expanduser('~'),
'stdout' : subprocess.PIPE,
'stderr' : subprocess.PIPE,
'universal_newlines' : True
}
with subprocess.Popen(**kwargs) as p:
for line in p.stdout:
print(line)
unfortunately I get the following error :
ERROR 1: PROJ: proj_get_authorities_from_database: Cannot find proj.db ERROR 1: Translating source or target SRS failed: ESRI:54009
When I run the command directly from my terminal It works flowlessly.
I imagine that I have some environment parameter missing or pointing to the wrong direction but I don't know where to start.
Any idea where I should check differences between the two execution env?
EDIT
I run Jupyter notebook from a company cloud interface, I have 0 idea of the installation, I have 0 right to access it. It's running on linux AWS instances.
several test that I performed :
!gdalwarp --version
give me the same result in the terminal and the jupyter notebook : GDAL 3.0.4, released 2020/01/28
!printenv | grep PROJ_LIB
I have nothing in the terminal env and PROJ_LIB=/usr/local/lib/python3.6/dist-packages/rasterio/proj_data in the notebook.
If I run this command in another notebook I get 0 errors and the PROJ_LIB
variable is not set. I think my install of rasterio and gdal are coliding is it possible ?