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

Hey,

is it possible to create a change file in geographical boundaries with osmupdate.

I already tried:

osmupdate germany-latest.osm.pbf 2014-11-23T21:22:02Z change_file.osc.gz -B=germany.poly

But the Change File always contains the entire globe.

regards

lakul

asked 25 Nov '14, 11:40

lakul83's gravatar image

lakul83
26225
accept rate: 0%

edited 25 Nov '14, 11:55


Yes it is possible, but it is a bit more complicated.

First you update your extract with osmupdate:

osmupdate germany-latest.osm.pbf germany-updated.osm.pbf -B=germany.poly

Then you calculate the differences with osmconvert:

osmconvert germany-updated.osm.pbf germany-latest.osm.pbf --diff --fake-lonlat --emulate-osmosis -o=diff.osc

This gies you the desired osm change file. After that you probably want to rename germany-updated.osm.pbf to germany-latest.osm.pbf to be able to run the same process again to get the next diff.

It has a slight problem though: you might get incomplete extracts when ways or relations move inside your boundary. This is why I do a slightly more complicated variant for the swiss extract on planet.osm.ch:

use a larger bbox around swizerland:

BBOX="5,45.3,11.3,48.3"

update this bbox:

osmupdate chbbox_updated.o5m chbbox.o5m --minutely -b=$BBOX

cut out switzerland from this larger region:

osmconvert chbbox_updated.o5m -B=$CHPOLY -o=switzerland_updated.o5m

and create the diff between the old cut out and the new one:

osmconvert switzerland_updated.o5m switzerland.o5m --diff --fake-lonlat --emulate-osmosis -o=diff.osc
permanent link

answered 25 Nov '14, 13:01

datendelphin's gravatar image

datendelphin
23446
accept rate: 14%

Hi,

many thanks. This idea I had. The update of the file germany-latest.pbf but takes too long. I would like to update my tile server every 5 minutes.

Greetings Lakul

(25 Nov '14, 14:01) lakul83

This is ambitious. If your server is too slow, you will have to rely on other resources or tools. For example overpass offers augmented diffs: http://wiki.openstreetmap.org/wiki/Overpass_API/Augmented_Diffs But it only support BBOX for extracting a region. Or let someone with a fast server provide you with the regional diffs.

(25 Nov '14, 19:29) datendelphin

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:

×199
×127
×47
×35
×3

question asked: 25 Nov '14, 11:40

question was seen: 4,004 times

last updated: 25 Nov '14, 19:29

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