maposmatic-dev
[Top][All Lists]
Advanced

[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

Hello,

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

 1. Downloads france.osm.bz2

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

 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 settings_local.py
    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
-- 
Thomas Petazzoni                         http://thomas.enix.org
Promouvoir et défendre le Logiciel Libre http://www.april.org
Logiciels Libres à Toulouse              http://www.toulibre.org

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]