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

I would like to maintain a partial mirror of the OSM database, so to be able to keep - and to fetch only the updates - of that specific area, that would be custom (the Alpine area) without the need to maintain a copy of the whole world.

One purpose of that, would be to monitor daily changes for that area (simply out of curiosity), another - way more important - would be to be able to generate mapsforge map files that are very up-do-date without downloading the whole data for the area any time.

I was only able to find how to run a complete Planet mirror though. Is it possible to only mirror a part of the Planet? If so, how?

If that's not possible, what is the best way to keep a local OSM copy and fetch only the updates whenever I want to? There is plenty of documentation out there, but I am unable to realize what is the best road to follow (ie overpass vs postgresql, as far as I was able to understand). Thanks!

asked 30 Apr '15, 14:27

Superfebs's gravatar image

accept rate: 0%

  1. create sub-section of planet file ("alpine.osm.pbf" or so) with osmosis and the --bp task (requires a .poly file describing the area)
  2. create initial state.txt file for osmosis replication (file must contain timestamp of when your base snapshot was taken)
  3. initialize osmosis replication (--rrii)
  4. run osmosis to update your file like so: osmosis --rri --simc --read-pbf alpine.osm.pbf --ac --bp file=alpine.poly clipIncompleteEntities=yes --write-pbf alpine-new.osm.pbf
  5. mv alpine-new.osm.pbf alpine.osm.pbf (or you can even compute the differences before you do)
  6. goto 4 as often as you want

This method downloads the world-wide diffs, applies them to your file (so that for a moment a new tree mapped in South America would be added) but then immediately cuts out your area of interest again so that only the bits that apply to your area are saved, and you will always have a current .osm.pbf file of your region.

Import into a database with osm2pgsql at will, but it's not necessary. Depends on what you want to do with the data.

permanent link

answered 30 Apr '15, 14:53

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

Thank you. I'll tackle one step at a time. For what matters the first one, is there any GUI tool to generate a .poly file? (Sorry, I am a newbie).

(30 Apr '15, 14:59) Superfebs

There is also good advice here: and Zverik's tools are very useful particularly

JOSM or QGIS can be used to create .poly files

(30 Apr '15, 15:43) SK53 ♦

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]( "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: 30 Apr '15, 14:27

question was seen: 5,051 times

last updated: 30 Apr '15, 15:43

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