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

Few months ago I donwloaded full planet.osm dump and imported it in postgresql database via osm2pgsql. Later I removed the dump file. Thats why I don't know the timestamp of my current osm data. How can I get this timestamp?

If I will know this timestamp, how can I download and import to my postgresql database the diff between this timestamp and now?

P.S.: import the full dump again is bad idea, it is too slow.

asked 31 Jan '17, 19:32

kz_sergey's gravatar image

kz_sergey
31224
accept rate: 0%


Applying diffs is much slower than the full planet load; if you want to apply diffs for a few months then it is almost certainly going to be faster to drop the database and load it again. (It could be that applying one day's worth of diffs takes more than a day!)

Having said that, here's how to update:

  1. Find out the highest node ID you have in your database (if you have used flatnodes, then running nodecachefilereader will tell you, else do a select max(id) from planet_osm_nodes).
  2. Get https://svn.openstreetmap.org/applications/utils/whichdiff/whichdiff.pl
  3. Run perl whichdiff.pl [highest_node_id]
  4. Install osmosis, run osmosis --rrii do initialize a status directory, and copy the state.txt file that you got in step 3 into that directory. Check the max_interval setting in configuration.txt and perhaps set it to 3600 (update only one hour) initially to see how long it takes to update one hour. You can re-run the following as often as you want until you arrive at the current end of the data:
  5. run osmosis --rri --write-xml-change mydiff.osc.gz
  6. load mydiff.osc.gz into your database using the same osm2pgsql and same options as you used when doing the initial load, just use --append istead of --create
permanent link

answered 31 Jan '17, 21:06

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:

×263
×7

question asked: 31 Jan '17, 19:32

question was seen: 3,250 times

last updated: 31 Jan '17, 21:06

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