0

Trying to cut geotif with a shp file.

When I open Python command line interpreter and run

from osgeo import gdal

gdal.Warp(outfile, infile,format='GTiff', cutlineDSName=shpfile,  srcSRS='EPSG:4326', dstSRS='EPSG:4326', dstNodata=-9999)

it creates the geotif as expected, though shows following output:

Warning 1: for band 1, destination nodata value has been clamped to 0, the original value being out of range.
<osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x7f8c72ac5b10> >

When I do the same within a web server, doing file preparation (projection, transparency, etc.) first with gdal and then trying to cut the file with the same command I get an empty file (0 bytes) and server (gunicorn) restarts.

Machine:

Linux Mint 18.3

Libraries versions:

gdal==2.2.2
proj==4.9.3
geos==3.6.2
python==2.7.12
gunicorn==19.7.1

Does anyone have any idea how to make it working in the web server environment?

0

After reinstalling the whole system with:

proj==4.9.2
gdal==2.1.3

everything started to work like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.