I have a very large raster whose GDAL Info is as below:
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`
I want to extract from it a part of data as xyz file. But I cannot seem to know how to do it. I have tried `gdal_translate -of XYZ -a_ullr -89.2972 60.0378 -117.719 44.901 "D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif" "D:/Mesh/MRB/ascii shangguan for NCRB 0125 .xyz"
but it writes an xyz file more than 100GB and the size is increasing even more than 100GB as I write the question. Can I just have the data for "-89.2972 60.0378 to -117.719 44.901"?
COMPRESSION=DEFLATE
and it holds 32 bit dataType=Int32
. Such data as an uncompressed plain text format like XYZ takes evidently much more space. Your gdal_translate command does not make sense at all. Read gdal.org/gdal_translate.html-a_ullr ulx uly lrx lry: Assign/override the georeferenced bounds of the output file
. What you need is -projwin which is documented on the same page. And think again what is upper left and what is lower right before giving values for -projwin.gdal_translate -of XYZ -projwin -117.719 60.0378 -89.2972 44.901 "D:\\Mesh\\Shangguan et al. (2016) Bedrock data\\BDTICM_M_250m_ll.tif" "D:/Mesh/MRB/ascii shangguan for NCRB 0125 .xyz"
? For comparison try also with GeoTIFF output. The output size should be so small that compression or tiling are not important. Remember from your other question that reading a block from a tiff file that is written row by row is inefficient and tiled tiff would be faster and take much less memory.