I want to merge two osm files (a certain area and the corresponding contour lines). The purpose is to create a combined osm file to be further processed with mkgmap. Situation The first file is a regular osm file coming from Overpass Turbo (with Meta attributes). The second was originally an shp file with contour lines of the same area, coming from a cartographic server of my region. I opened it in JOSM with the plugin OpenData and saved it as osm. Correctly, JOSM creates id's for each object, but not a "Version" attribute. Problem I want to merge both files using a command line program under Windows. I tried with Osmosis, but it fails because of the missing Version attributes in the second file. Any suggestion on how to force JOSM to produce Version attributes or to convince Osmosis to ignore the missing attributes? asked 28 Jan '20, 11:47 stenan |
I would try to open both files in JOSM and merge the layers with it. answered 28 Jan '20, 13:34 H_mlet Thanks, but this is not the idea. Maybe I should add a bit of context. I'm a hiking guide. Every time I explore a new hike, I want to have a fresh Garmin map for the area. Of course, paths change frequently, but contour lines don't. Thus, the process should look like this:
A. launch wget to download an up-to-date osm file related to the small area of my interest B. launch osmconvert to cut the big osm file with the contour lines along the same bounding box C. launch osmosis (or similar) to merge the two osm files D. launch mkgmap to produce the map using a proper style sheet Point C is where I'm stuck because of the missing Version attributes. All the rest works well. Thanks
(28 Jan '20, 16:04)
stenan
I think you can fake version ids with osmconvert, see --fake-version here http://manpages.ubuntu.com/manpages/trusty/man1/osmconvert.1.html
(28 Jan '20, 20:32)
SK53 ♦
Right, sorry I did not pay enough attention to the stance "command line program under Windows." I was going to suggest osmium, as I've read it's much more flexible than osmosis, but I don't see any windows version. As .osm is just xml, I think it should be quite easy to add a dummy Version attribute (put "1" everywhere). I would use sed, but if don't already have cygwin, it will be complicated. But search and replace tools must exists for windows. You might also find an xml tool for windows commandline. Regards.
(28 Jan '20, 21:06)
H_mlet
|