[OSM-dev] How do I build the latest db schema?
Frederik Ramm
frederik at remote.org
Sat Jul 7 12:53:33 BST 2007
Hi,
> Recently I've learnt more about the OSM schema and I'm not loading the
> data correctly, you will need to correct a few things after load. For
> example, it's not populating the current tables so a separate query will
> need to be run to copy this data from the history tables.
Is the following correct:
(a) if you want to run the rails API against the data, then assuming you
have freshly loaded the history tables using osmosis, you can simply
insert into current_nodes select * from nodes;
insert into current_segments select * from segments;
insert into current_ways select id,user_id,timestamp,visible from ways;
(b) if you only want to read the "current" tables as if you were
operating on live data, but don't need write access, then you can
drop table current_nodes; create view current_nodes as select * from nodes;
drop table current_segments; create view current_segments as select *
from segments;
drop table current_ways; create view current_ways as select
id,user_id,timestamp,visible from ways;
(don't know about the efficiency of MySQL views though.)
Do you plan to make osmosis use the ability to store multiple versions
of the same object? I.e. when I import the planet file each week and a
change is detected, the old object is kept and a new version is created.
This would of course never be the same as on our central server because
osmosis will lack intermediate changes (and thus, the "way" version
numbering wold not be the same), but it would be as close to the real
thing as one can get without downloading each individual object history.
Bye
Frederik
More information about the dev
mailing list