[gdal-dev] Error in gdalwarp

Even Rouault even.rouault at spatialys.com
Mon Oct 24 03:51:50 PDT 2016


> Rather tricky. The same analysis seems to run fine, however, on the same
> data with different software.

On individual polygons yes. But if you just aggregate all the polygons as a 
multipolygon (what gdalwarp does), it becomes invalid.

> What would be your advice for gdalwarp usage in QGIS>Processing? Just
> adding GDALWARP_IGNORE_BAD_CUTLINE YES by default, and perhaps an extra
> option to disable it?

Possibly. I've just fixed the issue per https://trac.osgeo.org/gdal/ticket/6694 
and will issue a GDAL 2.1.2 RC4 with that extra fix.

> 
> > Probably that in the use case you point, the way the multipolygon is
> > built should be revised to use a proper unioning operation instead of
> > the current rather naive way. Could be worth a ticket.
> > 
> > You can do that step manually with:
> > 
> > ogr2ogr cutline.shp -sql "select st_union(geometry) from watersheds"
> > watersheds.shp -dialect sqlite
> 
> Unfortunately this removes all internal borders, making it unusable for
> the original purpose.

Hum, I'm not sure to understand. I don't see any difference when running 
gdalwarp with your cutline (with --config GDALWARP_IGNORE_BAD_CUTLINE YES or 
after my fix) or the cutline resulting of the union (anyway my fix doesn't 
involve union'ing). Or perhaps if you enable blending ?

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list