On 23 December 2011 00:09, Michel Seuthe <[email protected]> wrote:
> I got a question left... If i add the linestring-column to the ways table
> _after_ I imported all the data, is there a way to fill this column without
> re-import everything?
>
Yes in theory, no in practice.
Technically it's as simple as running this statement (it's in the
pgsnapshot_load_0.6.sql script).
UPDATE ways w SET linestring = (
SELECT ST_MakeLine(c.geom) AS way_line FROM (
SELECT n.geom AS geom
FROM nodes n INNER JOIN way_nodes wn ON n.id = wn.node_id
WHERE (wn.way_id = w.id) ORDER BY wn.sequence_id
) c
);
However for large datasets it is horrendously slow. It is usually much
faster to get Osmosis to do it, especially if you have enough RAM to use
the nodeLocationStoreType=InMemory option on the --write-pgsql or
--write-pgsql-dump task.
The raw data load is relatively fast. Building indexes and running CLUSTER
statements consumes most of the time.
Brett
_______________________________________________
osmosis-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/osmosis-dev