Server
I have an existing private osm server running with postgresql (osm2pgsql) and rendering it with mapnik/mod_tile. The server has the whole planet.
Problem
I have a map with additionnal changes on a specific location in the .osm (I’ll call it newmap.osm) format and I want to integrate it into my existing map.
The map was generated with the “Global mapper” software.
What I’ve done
I’ve thought to transform the the .osm map into an .osc change file so I did this protocol with the osmium tool :
- Since I still have the planet osm.pbf file, I extracted the last IDs
- I did a sort on the newmap.osm
- I did a renumber with the last IDs from the planet file +1 on newmap.osm
- I merged the maps into another file
- I derived the changes between the old planet file and the new one I made to obtain the change file
- I appended the osc file with osm2pgsql
- I deleted all the cached rendered tiles and restarted the renderd service
Result
Nothing changed on my map when I access it from the web page and I’m out of ideas, could someone help ?
Your approach is not wrong as far as I can see, but quite complicated and chances are you did something wrong in one of the steps. From the description it sounds like your changes are only additions to the existing data, no deletions or modifications. In that case it should also be possible to just convert the newmap.osm
to newmap.osc
(after the renumber) using osmium cat
without the steps involving the planet file.
But there is a much easier way: Import your data into the database using a different schema or table prefix. Then just copy over all the contents created in any of the tables over into the tables you filled from the OSM data. And you are done. Don’t even need the renumber because the IDs are only important when updating the database which you are not doing.
Also before you do anything else, import your data on its own and try rendering it. If that doesn’t work, you know something is wrong with the data you generated.
1 Like
Hello, thank you for your time.
So I tried to render the map on its own, and there was nothing rendered.
I talked to the person who did newmap.osm, and it seems that their shapefile was composed of vectorial data ? Then they converted it into a .osm file.
I’m totally noob to openstreetmap, but is it a problem for my server ? Because if I remember correctly it can only render raster data.
Thanks again !
I’m bumping the subject because I’m still stuck at that point, sorry if it seems disrespectful, I’m just really lost.
I suspect that you’ll need to describe in detail the steps that you actually took, and if possible link to a copy of the new data somewhere.
Sorry I can’t share the data of my map, it is for a company.
For the map,
- I did a “osm2pgsql --create” command, thus crushing the planet map I had on my database and replace it with my new map.
- Then I granted all rights to the map to the user of renderd.
- Finally I restarted renderd.