Why not ask your question on the new OpenStreetMap Community Forum?

Hello all,

I have a local OSRM server where I do some traffic simulations for studies, and I need to change some maxspeeds on the map.

What I am trying to do:

  • Download a pbf from geofrabrik
  • use osmosis to cut a small chunk where I want to edit. -
  • edit the chunk with JOSM And now I am stucked on how I merge the edits with the original pbf. I tried use osmosis to calculate diff, but if I use:

    osmosis --read-xml file="sudeste-latest-osm_02.osm" --read-pbf file="sudeste-latest.osm.pbf" --derive-change --write-xml-change file="changeset.osc"

When I apply the diffs to the original "sudeste-latest" with:

osmosis --read-xml-change file="changeset.osc" --read-pbf file="sudeste-latest.osm.pbf" --apply-change --write-pbf file="sudeste-new.osm.pbf"

The output file contains only the chunk that I updated.

If I calculated the diffs with:

osmosis --read-pbf file="sudeste-latest.osm.pbf" --read-xml file="sudeste-latest-osm_02.osm" --derive-change --write-xml-change file="changeset.osc"

When I apply the osc, none of my changes was applied. What I'm doing wrong?

Thank you!

asked 27 Apr '21, 19:52

rafaelricco's gravatar image

accept rate: 0%

edited 27 Apr '21, 19:54

Osmosis doesn't understand the JOSM xml file.

Osmium might work (I'm not sure): https://docs.osmcode.org/osmium/latest/osmium-apply-changes.html

If you create objects, you might also have to synthesize positive ids for them to satisfy the OSRM importer (I don't know if it supports negative ids or not).

permanent link

answered 28 Apr '21, 03:08

maxerickson's gravatar image

accept rate: 32%

Nice! I will give a try using Osmium!

Apparently, if instead of derive changes from the bigger pbf, I use the edited chunk against the non-edited chunk:

osmosis --read-xml file="sudeste-latest-osm_02_new.osm" --read-pbf file="sudeste-latest-osm_02_old.osm" --derive-change --write-xml-change file="changeset.osc"

Them the changeset was applied to the original pbf, but Osmium seems to me to be more cleaner, let see!

Thank you!

(28 Apr '21, 18:18) rafaelricco
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 27 Apr '21, 19:52

question was seen: 1,922 times

last updated: 28 Apr '21, 18:18

powered by OSQA