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
0 votes
1 answer
95 views

Is it possible to warp a raster using -te in other projection?

I have some files in EPSG:4326 and some in "ESRI:102027". I use warping with -te argument in EPSG:4326: gdalwarp -overwrite -of GTiff -t_srs srs -te xmin ymin xmax ymax -te_srs "EPSG:...
Nikolay Yasinskiy's user avatar
1 vote
1 answer
485 views

Using Raster Calculator without Clipping to Extent of Smallest Raster (QGIS)

(QGIS3) I'm trying to create a raster layer that is the sum of 2 layers, but I do not want to clip to the smallest extent. The raster calculator in QGIS automatically trims the new file to the ...
Carter Dills's user avatar
0 votes
0 answers
372 views

Cropping tile map into raster using QGIS

I want to create a layer background for my data map. I am using a WMTS layer or a mbtile file (layer B), it could be an OpenStreetMap. My plan is to merge this layer with a data layout which has holes ...
kFly's user avatar
  • 869
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
0 votes
0 answers
572 views

Shifting in pixel after subsetting with gdalwarp

I am trying to subset multiple image to smaller Area of interest I have tried with gdal_translate & gdalwarp in commandline but it causes slight shift in pixel in the output raster after cropping/...
Tua's user avatar
  • 57
1 vote
1 answer
183 views

Errors clipping a raster with a vector mask layer

I am running QGIS 3.4.14 (current stable version) on OSX Mojave 10.14.5. I have a vector mask that I want to use to clip out a region of an image. Image was a jpeg originally but I translated it to a ...
Rob's user avatar
  • 189

15 30 50 per page