Skip to main content

All Questions

Tagged with
0 votes
1 answer
184 views

Passing geometry dataset type to gdal.Warp() for a clip operation - order of operations and file type confusion

Trying to wrap my head around the correct order of operations and file type(s) required by gdal.Warp(). I have a valid geometry object created from the shapely object.unary_union.convex_hull method. ...
bashity's user avatar
  • 109
0 votes
1 answer
55 views

Can't use Polygon to Clip Raster

I created a polygon to use to clip a DTM raster (DEMTiff), but the Clip by Mask tool gives an error: GDAL command: gdalwarp -overwrite -of GTiff -cutline temp.shp -cl temp -crop_to_cutline "D:\\...
Jeff C's user avatar
  • 1
1 vote
1 answer
431 views

Inconsistent results between gdalWarp (with cutline) and rasterio.mask

Cropping with GDAL cutline vs Rasterio.mask with crop=True results in arrays with different sizes (by one row). I've tested the different Rasterio options but no luck. I'm hoping to match the GDAL ...
bbuzz31's user avatar
  • 429
4 votes
1 answer
163 views

Gdalwarp clip with negative buffer

Is there any simple way to change this command: gdalwarp -tr 10 10 -cutline "shape.shp" -crop_to_cutline -of GTiff "S1A_IW_GRDH_1SDV_20200719T161950_20200719T162015_033526_03E28C_C720....
Flash Thunder's user avatar
1 vote
1 answer
434 views

Cropping with GDAL python outputs a black section in the image

I am trying to crop an image using GDAL python. I have tried using both gdal.Warp and gdal.Translate, and both keep bringing the same result. I have an image that I have orthorectified using gdal.Warp ...
haveaniceafterlife's user avatar
0 votes
1 answer
207 views

Clip Raster with Shapefile GDAL API

I am trying to clip a raster using a polygon an GDAL. The following code is running without an error but the ouputimage is all zeros. All files are in the same CRS. Is there a way to use GdalWarp with ...
Roots19's user avatar
0 votes
2 answers
1k views

Problem with gdal.WarpOptions concerning reference

I have a tiff file that I want to crop down to a shp cutline and reproject. If the code is: clip_spec=gdal.WarpOptions(format='GTiff',cutlineDSName=os.getcwd()+'/moksha/DEM/cutline2.shp',cropToCutline=...
Nikolay Yasinskiy's user avatar
3 votes
1 answer
791 views

Cropping raster file with GDAL warp C++ API

I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation. The algorithm is written in C++ so I want to call ...
Chang's user avatar
  • 310
2 votes
1 answer
648 views

Incorrect results while cropping with gdalwarp and cutlineSQL

Environment: Windows 10, Python 3.7, Numpy 1.18 and GDAL 3.0.2 Data required: Single band raster Polygons on same area with an attribute "name" The code below works fine and cuts the data ...
PKG's user avatar
  • 610
2 votes
1 answer
760 views

Results of gdalwarp from UTM32 to EPSG:4326 are not aligned?

I've a Sentinel 2 jp2 in UTM32 with this metadata: Files: T32UQD_20200421T102021_TCI_60m.jp2 Size is 1830, 1830 Coordinate System is: PROJCS["WGS 84 / UTM zone 32N", GEOGCS["WGS 84", ...
Bằng Rikimaru's user avatar
5 votes
0 answers
2k views

"Clip Raster by Mask Layer" produces zero values (and not Nodata) outside mask boundaries

This is my first question here. I have a big raster of the world's nighttime lights and want to clip it down to the Adm0 of a country: In order to do so, in QGIS 2.18 what I do is using the Clipper ...
EnricoVac's user avatar
1 vote
1 answer
2k views

FAILURE: No target filename specified

Each time I run gdalwarp -te 212051.9319179999874905 214051.9319179999874905 183962.2946890000021085 Quada.tif Clipped.tif I get the following error: FAILURE: No target filename specified. Any ...
user1655130's user avatar
2 votes
1 answer
1k views

Clipping .tif with gdal Warp produces blank image

I have four band .tif that I am trying to clip to the shapefile extent with: gdal.Warp(OutDS, inRaster, cutlineDSName = InShapefile1, cropToCutline = True, dstNodata = inNoData) using Python and ...
Alešinar's user avatar
  • 841
4 votes
1 answer
520 views

Clipping area from big raster without Resampling

I'm trying to polygonize a raster. The raster is a very big raster so I try to clip it with gdalwrap and a polygon in a shp file as mask. After cliping (and polygonize it) I see that the pixel are ...
Mquinteiro's user avatar
2 votes
1 answer
654 views

Why does clipping netCDF in QGIS change cell values?

My problem goes like this: I have a gridded data in netCDF file. The cells have values in meters. For example: 0,012. I only need a small area of the grid and after clipping it in QGIS using a ...
crisvr's user avatar
  • 65

15 30 50 per page