I've downloaded the SRTM DEM files for most of Europe, from both 3arc_v4.1 and 1arc_v3 versions. The first comes in 5x5 degrees tiles, the latter in 1x1. I can stitch them together with gdalbuildvrt into a huge file (208801x90001 pixels, according to gdalinfo). So far so good; I can even generate terrain coloring, hill and slope shading without a problem (except time, of course).

What I can't do is to generate contour lines for it. gdal_contour either runs out of RAM (8GiB) or reaches the ESRI Shapefile file limit (2GiB, I think). I can generate shapefiles for each individual tile and then run shp2pgsql to import it, but the problem is at the tile limit: The contour lines from one tile cross the correlative one from the next tile. For example:


So the question is: is it possible to import such big datasets, in particular directly to PostGis? if not, is it possible to stitch the individual ones before importing into PostGis?

migrated from stackoverflow.com Feb 20 '15 at 13:47

This question came from our site for professional and enthusiast programmers.

  • If you use raster2pgsql you can load multiple tiles into one raster coverage. Then, you could use something like the query here to select 9 sets of tiles, contour the middle one, move on to the next one, etc. It probably won't be very fast, but it is doable. – John Powell Feb 16 '15 at 9:19
  • Well, I could also generate 9-tile virtual tiles with gdalbuildvrt to replace importing the raster files to PostGIS, and then "generate the contour for the middle one". – Marcos Dione Feb 22 '15 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.