3

I am struggling with this several days and now its time to ask how to do it in QGIS.

I have very detailed 27 ASC grid files with overall size of 9 GB created from 1m contours of large area (600 m2). The goal is to merge all this data into one DEM for easier handling (output will be smaller i think ?) and later to create a slope, hillshade color shaded reliefs ,etc for whole area easier.

Available Data:

  1. I have simplified contours for whole area in SQL Sever which are much less in size than original ones.
  2. ASC files are created from original contour data and I would like to create one DEM from that.

I have tried next QGIS/GRASS solutions with simplified contours of a whole area:

but I had only success in rasterizing contours (v.to.rast.attr). That creates a 218 MB TIF with dimensions of 37945 x 30143. But, in the next step when I start 'r.surf.contour' it just hangs forever (last try was 24 hour long and then I quit, although process was very active and consumed almost all memory (6GB RAM). Is this too large dataset and this is normal execution time on modern PC configuration ?

Other way would be to use ASC files and to merge it to one DEM. If someone could give me information how to do it efficently or some detailed workflow would be great.

I would say that the purpose of DEM will be to create a shaded relief as a background for printing 1:5000 maps.

UPDATE:

Well I have converted all 27 ASC to GeoTiff and also realized there are 3 more grids (.grd) which has been made by GS Surfer 12. I converted them also in GeoTiff. Now when I try to build VRT next thing happens:

  • The first of 27 GeoTifs are joined into VRT but I've lost all elevations. VRT have only one value (167, which is the lowest value from all dem's included).

  • Those 3 files built from Surfer GRD have somehow different characteristics and it wont join with others.

**

> Warning 6: gdalbuildvrt does not support heterogenous band
> characteristics. Skipping D:/DEM (GeoTIFF)/OF_IZO_28_dem.tif

**

gdalinfo for one tif in original group:

Driver: GTiff/GeoTIFF
Files: D:/DEM (GeoTIFF)/OF_IZO_27_dem.tif
       D:/DEM (GeoTIFF)/OF_IZO_27_dem.tif.aux.xml
Size is 5001, 5001
Coordinate System is `'
Origin = (7584999.500000000000000,4795000.500000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Image Structure Metadata:
  COMPRESSION=PACKBITS
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 7584999.500, 4795000.500) 
Lower Left  ( 7584999.500, 4789999.500) 
Upper Right ( 7590000.500, 4795000.500) 
Lower Right ( 7590000.500, 4789999.500) 
Center      ( 7587500.000, 4792500.000) 
Band 1 Block=5001x1 Type=Float32, ColorInterp=Gray
  Min=243.000 Max=834.072 
  Minimum=243.000, Maximum=834.072, Mean=503.092, StdDev=130.621
  NoData Value=-1
  Metadata:
    STATISTICS_MAXIMUM=834.07208251953
    STATISTICS_MEAN=503.0916431759
    STATISTICS_MINIMUM=243
    STATISTICS_STDDEV=130.62100147903

gdalinfo for one tif made from Surfer .grd>

Driver: GTiff/GeoTIFF
Files: D:\DEM (GeoTIFF)\OF_IZO_31_dem.tif
       D:\DEM (GeoTIFF)\OF_IZO_31_dem.tif.aux.xml
Size is 2125, 3512
Coordinate System is `'
Origin = (7587875.569015772100000,4790000.499983053700000)
Pixel Size = (0.999968455743971,-0.999966106522373)
Image Structure Metadata:
  COMPRESSION=PACKBITS
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 7587875.569, 4790000.500) 
Lower Left  ( 7587875.569, 4786488.619) 
Upper Right ( 7590000.502, 4790000.500) 
Lower Right ( 7590000.502, 4786488.619) 
Center      ( 7588938.036, 4788244.560) 
Band 1 Block=2125x1 Type=Float64, ColorInterp=Gray
  Min=409.000 Max=1239.595 
  Minimum=409.000, Maximum=1239.595, Mean=679.431, StdDev=154.121
  NoData Value=1.7014100000000001e+038
  Metadata:
    STATISTICS_MAXIMUM=1239.5948358501
    STATISTICS_MEAN=679.43099985765
    STATISTICS_MINIMUM=408.9999998738
    STATISTICS_STDDEV=154.12086745843

How I would correct this and get all grids in VRT with preserved elevations ?

7
  • 2
    I've had success merging raster files using gdalbuildvrt to create a .vrt virtual raster, then gdal_translate or gdalwarp to convert the virtual raster to a single image. If you convert your ASC files to compressed GeoTIFF files first you'll have less headaches with memory - you can do this with gdal_translate. Commented Aug 15, 2014 at 8:24
  • Thanks Snorfalorpagus! I think about that option but I was not sure is it possible to create new raster from .vrt.
    – sys49152
    Commented Aug 15, 2014 at 8:41
  • What settings I need to create GeoTIFF with preserved elevations ?
    – sys49152
    Commented Aug 15, 2014 at 8:46
  • 1
    you can always create new raster from vrt, but in many case you do not need to. you can simply handle your vrt like any other format.
    – radouxju
    Commented Aug 15, 2014 at 9:41
  • 1
    I'd just point out that your grid extent of about 40,000 by 30,000 cells means 1.2 billion cells. If the raster is float32 values (4 bytes) then that means a raster of 6 GB. (I'm not sure about your statement that v.to.rast creates a 218 MB tiff file). That's going to be slow on your machine no matter what you do... Can you consider reducing the resolution?
    – Micha
    Commented Aug 15, 2014 at 15:40

0

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.