openstreetmappostgisosm2pgsqlosm.pbfosmium

Impossible to merge osm.pbf file properly


I've recently started to work on a project with SRTM datas and I've extracted pbf file using phyghtmap.

To start I'm getting hgt files, converting them to tif using the following command : gdal_fillnodata.py data.hgt data.tif

Then I'm warping them with gdalwarp -co BIGTIFF=YES -co TILED=YES -co COMPRESS=LZW -co PREDICTOR=2 -t_srs "+proj=merc +ellps=sphere +R=6378137 +a=6378137 +units=m" -r bilinear -tr 90 90 data.tif warp-90.tif

And finally creating the pbf file with phyghtmap --max-nodes-per-tile=0 -s 10 -0 --pbf warp-90.tif

The results is a list of pbf files. They are perfectly fine when I load them into PostGIS with osm2pgsql. But I want to merge them to fasten the import.

I've tried all the major solutions:

None of them worked and the result is only a very small fraction of the data merged in the result file.

Am I doing something wrong?

Note: If I load all pbf with --append it works, but it take ages for a very small portion of the world.


Solution

  • I found the issue. I wasn't setting the --start-node-id and --start-way-id in my script so all my pbf was using the same id range. Now I'm assigning unique ID and it work like a charm :)