[OSM-Devserver] Einspielen der DB (osmosis snapshot scheme)
Tobias Wendorff
tobias.wendorff at tu-dortmund.de
Mo Jul 25 17:45:40 CEST 2011
Am 25.07.2011 17:32, schrieb Tobias Wendorff:
> Rein rechnerisch bedeutet das: 6-7 Stunden pro täglichem Update!
Schlussfolgerung vorab: Die ganzen Berechnungen bei Updates werden
in der DB durchgeführt. Das dauert natürlich extrem lange.
Für alle, die es interessiert - solche Updates laufen da durch...
UPDATE ways w SET bbox = ( SELECT Envelope(Collect(n.geom)) FROM nodes n
INNER JOIN way_nodes wn ON wn.node_id = n.id WHERE wn.way_id = w.id )
WHERE w.id IN ( SELECT w.id FROM ways w INNER JOIN way_nodes wn ON w.id
= wn.way_id WHERE wn.node_id = $1 GROUP BY w.id )
mit Parameter: $1 = '276'
UPDATE ways w SET linestring = ( SELECT 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 )
WHERE w.id IN ( SELECT w.id FROM ways w INNER JOIN way_nodes wn ON w.id
= wn.way_id WHERE wn.node_id = $1 GROUP BY w.id )
mit Parameter: $1 = '276'
UPDATE nodes SET id = $1, version = $2, user_id = $3, tstamp = $4,
changeset_id = $5, tags = $6, geom = $7 WHERE id = $8
mit Parameter: $1 = '277', $2 = '20', $3 = '24', $4 = '2011-07-13
01:15:38', $5 = '8708131', $6 = '', $7 =
'0101000020E6100000E4D1D73DC3AB3040AFD579AFB5195140', $8 = '277'