<div dir="ltr"><div><br><br>On Sat, Mar 11, 2017 at 8:53 AM, Nikos Alexandris <<a href="mailto:nik@nikosalexandris.net">nik@nikosalexandris.net</a>> wrote:<br>><br>> Nikos Alexandris<br>><br>>>> Why does (attempting to) import a 38m pixel resolution GHSL [0] GeoTIFF<br>>>> layer, ie GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0_p1.tif, in GRASS'<br>>>> db progress slow?<br><br></div><div>because it is a very large raster map: Size is 507904, 647168<br></div><div>><br>><br>> (Apologies for cross-posting to gdal-dev)<br>><br>> Markus Neteler:<br>><br>>> Can you elaborate a bit more? I have downloaded and checked:<br>>><br>>> That is 9835059101  bytes in 19885 files or I downloaded the wrong one<br>>> (please post an URL).<br>><br>> For example <<a href="http://ghsl.jrc.ec.europa.eu/ghs_bu.php">http://ghsl.jrc.ec.europa.eu/ghs_bu.php</a>>,<br>><br>> see<br>><br>> GHS_BUILT_LDS1975_GLOBE_R2016A_3857_38 (768MB) GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38 (854MB) GHS_BUILT_LDS2000_GLOBE_R2016A_3857_38 (892MB) GHS_BUILT_LDS2014_GLOBE_R2016A_3857_38 (900MB)<br>><br>> "3857" is the EPSG code.  They are split in two GeoTIFFs (p1, p2) and<br>> there is a VRT along with overviews for it.  No overviews for the TIFFs.<br>><br>> For example:<br>><br>> GHSL_data_access_v1.3.pdf<br>> GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0.clr<br>> GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0.vrt<br>> GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0.vrt.ovr<br>> GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0_p1.tif<br>> GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0_p2.tif<br>><br>><br>> Even trying to clip, with gdal_translate, might create file(s) of<br>> hundreds of GBs. This might be due to missing compression.<br><br></div>then use compression. The source tiffs use LZW with blocks of 4096x4096 cells.<br><div><br>><br>> The import of p1 or p2 or of the VRT file in GRASS' data base, via<br>> r.in.gdal/r.import, does not progress at all.<br><br></div><div>Importing GHS_BUILT_LDS1990_GLOBE_R2016A_3857_38_v1_0_p1.tif with r.in.gdal took 1:31 hours on a laptop with SSD. The resultant cell file was 1.5 GB.<br><br></div><div>Recompressing with BZIP2 took 2:20 hours and the size of the cell file was reduced to a mere 143 MB.<br></div><div><br>> (<br>> Side question: why is max 2047?  What if there is a lot more of RAM?<br>> )<br></div><div>To avoid integer overflow because 2047 is converted to bytes with 2047 * 1024 * 1024.<br></div><div><br></div><div>Markus M<br></div></div>