[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] Implementing database update

From: Thomas Petazzoni
Subject: [Maposmatic-dev] Implementing database update
Date: Mon, 7 Sep 2009 23:29:15 +0200


Tonight, I had a look at how to update the OSM database. My idea was to
create a Python script (so that can be read) that :

 1. Downloads france.osm.bz2

 2. Runs osm2pgsql to import the data fix a prefix different from

 3. Run a single query that drop the old tables and rename the new
    tables to the old tables

The issue I'm having is that osm2pgsql not only creates tables, but
also a lot of indexes. Therefore, I'm not sure it's very easy to just
rename the tables.

Another solution we could experiment is the following :

 1. Downloads france.osm.bz2

 2. Create a new PostgreSQL user and a new PostgreSQL database

 3. Using osm2pgsql, import the data into the new PostgreSQL database

 4. Provided we extract GIS_DATABASE_NAME out from
    into a simpler file, we can overwrite this file with a new version
    that contains the name of the new database

 5. Remove the old database

Of course, this solution relies on the new feature implemented by d2,
in which the read-only geographic data can be kept separate from the
website/daemon read-write tables.

I'm attaching the beginning of Python script I've been working on.
Nothing really clean and usable, but shows the intention.

Thomas Petazzoni               
Promouvoir et défendre le Logiciel Libre
Logiciels Libres à Toulouse    

Attachment: maposmaticd-update-db
Description: Binary data

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]