[OSM-dev] Live Database Copy of Planet File
Lars Francke
lars.francke at gmail.com
Thu Nov 5 13:54:15 GMT 2009
> I don't really care for the changesets, just the data... (and only certain
> parts of that) I had this theory it could be done with a mix of Cron and
> Osmosis and was really looking at what to feed what it the right order.
> Once I've got it collecting the right files and putting it into postgres
> using Osmosis I can then replace Osmosis to do the extra preprocessing I
> want. All I was looking for was a simple step by step guide or an example. I
> don't want to reinvent the wheel.
> I think we need somthing on the wiki
1) Download a planet.osm-dump and a current Osmosis version (you may
have to build it yourself or I could upload a version somewhere)
2) osmosis --write-pgsql (with all the options you need)
3) osmosis --read-xml <your planet.osm> --write-pgsql-dump <your
database information>
4) osmosis --read-replication-interval-init workingDirectory=<your
working directory here>
5) - Now go to http://planet.openstreetmap.org/minute-replicate/ and
find the state.txt file that has a timestamp a hour or so before the
planet dump started (to be on the safe side) and copy it to your
working directory (and its "data" subdirectory, I can't remember the
correct location but copying it to both locations won't do any harm)
- Change the configuration.txt to point to /minute-replicate (the
default is wrong)
6) Set up a cron job following the example in
http://wiki.openstreetmap.org/wiki/Minutely_Mapnik but change a few
things:
- Replace read-change-interval with read-replication-interval
- Replace write-xml-change with write-pgsql-change
- Delete the osm2pgsql stuff
- As there currently are only minutely diffs you'd have to run this
cron job every minute (there is the "merge-replication-files" task in
Osmosis but I don't know if it is stable yet)
7) Enjoy your local osm database (in case I didn't forget anything)
But if you want to use it with JOSM you'd have to set up the Rails port, too.
Hope that helps.
Cheers,
Lars
Look up the correct options up on
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage
More information about the dev
mailing list