I have a 250m resolution raster file which is needed to be clipped using a mask layer. I am trying to do it with gdalwarp through Clipper tool in QGIS but it is taking forever. I tried using R (mask function) but that too didn't help. Are there any methods to do it with less computational burden on the system? This is the code I was using gdalwarp -dstnodata -9999 -q -cutline "D:/Mesh/MRB/ncrb trial 2.shp" -tr 0.002083333 0.002083333 -of XYZ "D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif" D:/Mesh/MRB/result.tif. This is the datafile: (approx 7.5 GB). This is the gdal info data about the file: Driver: GTiff/GeoTIFF Files: D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif.aux.xml Size is 172800, 67200 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]] Origin = (-180.000000000000000,83.999167206000010) Pixel Size = (0.002083333000001,-0.002083333000001) Metadata: AREA_OR_POINT=Area ATTRIBUTE_LABEL=BDTICM_M ATTRIBUTE_MEASUREMENT_RESOLUTION=1 ATTRIBUTE_TITLE=Absolute depth to bedrock (in cm) ATTRIBUTE_UNITS_OF_MEASURE=cm [email protected] / [email protected] CITATION_ORIGINATOR=College of Global Change and Earth System Science, Beijing Normal University / ISRIC - World Soil Information CITATION_URL=http://dx.doi.org/10.1002/2016MS000686 CONFIDENCE_INTERVAL=M DATA_FORMAT=Byte DEPTH=None DOWNLOAD_FTP_URL=ftp://ftp.soilgrids.org/data/recent/BDTICM_M_250m_ll.tif HORIZON_LOWER_DEPTH=5000.00 m HORIZON_UPPER_DEPTH=0.00 m KEYWORD1=bedrock KEYWORD2=depth NO_DATA=255 PROJECT_URL=http://soilgrids.org PUBLICATION_DATE=2017-03-10 RANGE_DOMAIN_MAXIMUM=5000 RANGE_DOMAIN_MINIMUM=0 SERIES_NAME=SoilGrids250m SLD_NAME=soilgrids250m:BDTICM SLD_URL=ftp://ftp.soilgrids.org/legends/BDTICM.sld TECHNICAL_SPECIFICATIONS_URL=https://github.com/ISRICWorldSoil/SoilGrids250m Image Structure Metadata: COMPRESSION=DEFLATE INTERLEAVE=BAND Corner Coordinates: Upper Left (-180.0000000, 83.9991672) (180d 0' 0.00"W, 83d59'57.00"N) Lower Left (-180.0000000, -56.0008104) (180d 0' 0.00"W, 56d 0' 2.92"S) Upper Right ( 179.9999424, 83.9991672) (179d59'59.79"E, 83d59'57.00"N) Lower Right ( 179.9999424, -56.0008104) (179d59'59.79"E, 56d 0' 2.92"S) Center ( -0.0000288, 13.9991784) ( 0d 0' 0.10"W, 13d59'57.04"N) Band 1 Block=172800x1 Type=Int32, ColorInterp=Gray NoData Value=-32768 Overviews: 86400x33600, 43200x16800, 21600x8400, 10800x4200, 5400x2100, 2700x1050, 1350x525

  • 1
    How did you try to do that? Add also gdalinfo report about your source image. It may be suboptimal for clipping.
    – user30184
    Jun 24, 2017 at 20:07
  • @user30184 this is the code gdalwarp -dstnodata -9999 -q -cutline "D:/Mesh/MRB/ncrb trial 2.shp" -tr 0.002083333 0.002083333 -of Gtiff "D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif" D:/Mesh/MRB/result.tif Jun 28, 2017 at 21:41
  • Your source file is organized as rows Block=172800x1. Clipping would need less resources with tiled image. Make a tiled copy as gdal_translate -of GTiff -co tiled=yes BDTICM_M_250m_ll.tif tiled_BDTICM_M_250m_ll.tifand have a new try.
    – user30184
    Jun 28, 2017 at 21:42
  • @user30184 I did build tiled copy of the file but the data seems to have changed.. and there are a lot of differences between original and tiled data Jun 28, 2017 at 22:30
  • It should not change any pixel value. How did you notice the differences?
    – user30184
    Jun 29, 2017 at 4:23


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.