[Python] python gdal.warp doesn't properly crop raster over shapefile polygons

Discussão em 'Python' iniciado por Stack, Março 13, 2025.

  1. Stack

    Stack Membro Participativo

    [​IMG]

    I used this script to crop a raster using a polygon shapefile with python gdal.Warp, but it seems it leaves many pixels with value = 1 outside the cropline

    gdal.Warp(rasterOut.jp2,
    rasterIn.jp2,
    cutlineDSName=mask.shp,
    cropToCutline=True,
    dstNodata = nodata)


    I can select any nodata, like 0 or np.nan, but the results doesn't change

    Continue reading...

Compartilhe esta Página