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

2
1

I've got a copy of planet.osm.pbf and a subsection op_area.osm (bounded by bounds.poly) which covers several US states.

I've also set up a way to get the planet.osm diffs each week (rssdownloader + rtorrent + http://osm-torrent.torres.voyager.hr/files/rss.xml, for the curious), and it's trivial to automatically apply the diff to planet.osm.pbf and write out an updated version. Then I can clip the planet whichever way I want, and write a new op_area.osm.

The problem is, clipping the planet after applying a changeset takes ~6 hours with my current hardware. Is it possible to apply the planet-based diffs to op_area.osm using osmosis (or some other tool) without needing that intermediate step? I couldn't find any pipeline items that can take a change stream and apply bounds.

asked 22 Apr '14, 15:19

BarqsDew's gravatar image

BarqsDew
46115
accept rate: 0%

edited 22 Apr '14, 15:23


Do not clip the planet after applying diff; clip it while doing so. Most of the time spent doing this is very likely the reading and writing of the data. Your toolchain seems esoteric to me; what people would usually do to solve your problem is (all on one line, written here on multiple lines for clarity)

osmosis
   --read-replication-interval
   --read-pbf mylocalregion.osm.pbf
   --apply-diff
   --bp file=bounds.poly
   --write-pbf mylocalregion-new.osm.pbf

This is extremely unlikely to take six hours even on small hardware! Working with .osm.pbf files (and not with .osm.bz2 files or plain .osm files) is essential here for speed; if your CPU is particularly weak then adding "compress=none" to the write-pbf task could also improve things.

Before you can run Osmosis in the above fashion you will have to initialize the replication loading (--rrii, and modify configuration.txt if you want hourly or daily updates). You can of course download the diffs your way too and then replace the --read-replication-interval with a --read-xml-change myfile.osc.

permanent link

answered 25 Apr '14, 23:50

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

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:

×252
×127
×56
×11

question asked: 22 Apr '14, 15:19

question was seen: 4,016 times

last updated: 25 Apr '14, 23:50

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