NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the 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

rafaelricco
11111
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

maxerickson
12.7k1083176
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

Follow this question

By Email:

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

By RSS:

Answers

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:

×622
×352
×252
×60

question asked: 27 Apr '21, 19:52

question was seen: 4,022 times

last updated: 28 Apr '21, 18:18

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum