der-stefan / OpenTopoMap

A topographic map from OpenStreetMap and SRTM data
https://opentopomap.org
Other
473 stars 119 forks source link

Contours.pbf too small #302

Open mytracks opened 3 years ago

mytracks commented 3 years ago

Hi.

I am currently developing a container image containing the complete OpenTopoMap infrastructure (PostgreSQL, apache, etc.). I am using the instructions of this project as the basis. Most of the stuff seems to work so far. However, the generated contours.pbf file has only a size of 138 bytes. I assume that this is not correct.

The steps are coded in the following script: https://github.com/mytracks/opentopomap-tile-server/blob/main/otm/load_srtm.sh

I did load the SRTM files of the whole world: https://github.com/mytracks/opentopomap-tile-server/blob/main/otm/srtm_url.list

The execution of the complete script took about 6 days as far as I remember. I did no see any error message.

Does anybody know what the problem could be?

Thanks, Dirk

mytracks commented 3 years ago

I already found the cause of the problem: phyghtmap cannot be used for large maps. Nevertheless I am still searching for a replacement of it.

and01 commented 3 years ago

I faced the same problem with phyghtmap after a while it always crashed so I replaced it with gdal_contour.

mytracks commented 3 years ago

I faced the same problem with phyghtmap after a while it always crashed so I replaced it with gdal_contour.

I do not have any experience with gdal_contour. Can you provide a script or a command line that I can use as a replacement for the phyghtmap command?

and01 commented 3 years ago

You can generate contour lines with 10 meters interval like so:

gdal_contour -b 1 -a ele -i 10 raw.tif output.gpkg

You can write directly to the database or in this case to a geopackage file. Check the documentation here: https://gdal.org/programs/gdal_contour.html

Bear in mind that this process takes a lot of memory.