[gdal-dev] oblique cuts on a raster using python GDAL

Javier Jimenez Shaw j1 at jimenezshaw.com
Mon Nov 6 02:33:04 PST 2023


Hi Naima

I have been testing with your dataset. To me, using the GDAL in Ubuntu
22.04 (3.4.1) seems to be a problem with the JP2 output format. If you
output as geotiff it works fine.

On Sun, 5 Nov 2023 at 19:43, Rahkonen Jukka via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:

> Hi,
>
>
>
> Please add gdalinfo of the source image. Even better if you can share the
> image.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* gdal-dev <gdal-dev-bounces at lists.osgeo.org> *Puolesta *Naima
> Dambrine via gdal-dev
> *Lähetetty:* sunnuntai 5. marraskuuta 2023 17.35
> *Vastaanottaja:* gdal-dev at lists.osgeo.org
> *Aihe:* [gdal-dev] oblique cuts on a raster using python GDAL
>
>
>
> Hi ,
>
>
>
> I have problems with oblique cuts on a raster using python GDAL (3.6.2)
>
>
>
> - with this line i obtain black borders around :
>
> gdal.warp('raster-dst' , raster-src',
> cutLineDSName='geometry-extraction.shp', cropToCutline=True)
>
>
>
> - with this one, the crop is not clean on closer inspection: residual
> black pixels around image and white pixels appear in the image.
>
> gdal. warp( 'raster-dst' , raster-src',
> cutLineDSName='geometry-extraction.shp', cropToCutline=True,
> copyMetaData=True, dstNodata=0)
>
>
> I tried, without success, to refine with outputBounds=[minX, maxX, minY,
> maxY], under QGIS directly ….
> I've run out of ideas :/
> A (naive) question comes to mind: Is it possible to make oblique cuts with
> gdal.warp() & co?
>
> Naïma
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20231106/b11ac818/attachment.htm>


More information about the gdal-dev mailing list