Dimenticavo la query. Probabilmente è intutilmente complicata ma... sembra
funzionare.

--tabella con way entranti in rotatoria senza turn sul primo nodo
DROP TABLE IF EXISTS all_roundabout_entry_without_turn;
CREATE TABLE all_roundabout_entry_without_turn AS
SELECT w2.id AS id
FROM ways AS w1, ways AS w2, junctions AS j1, junctions AS j2
WHERE
w1.nodes[1] = j1.node_id AND
w1.nodes[array_upper(w1.nodes, 1)] = w2.nodes[1] AND
w2.nodes[array_upper(w2.nodes, 1)] = j2.node_id AND
j1.id = j2.id AND
NOT w1.tags ? 'junction' AND
NOT w2.tags ? 'junction' AND
w1.tags -> 'oneway' <> 'no' AND
w2.tags -> 'oneway' <> 'no' AND
w2.nodes[1] NOT IN (SELECT member_id
FROM relation_members WHERE member_type = 'N');
CREATE INDEX ON all_roundabout_entry_without_turn (id);
ANALYZE all_roundabout_entry_without_turn;
-- crea tabella con nodi delle way entranti, tranne primo ed ultimo
DROP TABLE IF EXISTS all_roundabout_entry_without_turn_nodes;
CREATE TABLE all_roundabout_entry_without_turn_nodes AS
SELECT unnest(w.nodes[2:array_upper(w.nodes, 1)-1]) AS nid, e.id AS wid
FROM all_roundabout_entry_without_turn AS e, ways AS w
WHERE w.id = e.id;
CREATE INDEX ON all_roundabout_entry_without_turn_nodes (nid, wid);
ANALYZE all_roundabout_entry_without_turn_nodes;
-- trova primo nodo delle way entranti che hanno nodi che appartengono a
più way
DROP TABLE IF EXISTS roundabout_entry_without_turn;
CREATE TABLE roundabout_entry_without_turn AS
SELECT 'n'||nodes.id AS osmid, 'no turn' AS desc, nodes.geom AS geometry
FROM nodes, ways AS w, all_roundabout_entry_without_turn_nodes AS e
JOIN (SELECT e.nid AS nid
  FROM way_nodes, all_roundabout_entry_without_turn_nodes AS e, ways AS w
  WHERE node_id = e.nid AND
  w.id = way_nodes.way_id AND
  w.tags -> 'highway' NOT IN ('footway', 'cycleway', 'path')
  GROUP BY e.nid, e.wid HAVING Count(e.nid) > 1) AS l ON (l.nid = e.nid)
WHERE
nodes.id = w.nodes[1] AND
w.id = e.wid
GROUP BY nodes.id;


Il giorno 27 marzo 2013 20:30, Groppo <grop...@gmail.com> ha scritto:

> Il giorno 27 marzo 2013 10:42, Aury88 <spacedrive...@gmail.com> ha
> scritto:
>
>> ...
>>
>> intendevo che potremmo filtrare e togliere dal report le strade che hanno
>> solo tre nodi in comune con altre strade. ...(naturalmente do per
>> scontato che si parli di sole highway
>>
>> percorribili dalle macchine...capita spesso che vi siano passaggi
>> pedonali e
>> quindi highway=footway o altro che attraversano i raccordi e questi non
>> dovrebbero venire contati)
>>
>
> Mi sembra una buona idea, ho cercato le way che soddisfano queste
> condizioni.
>
> Riassumendo:
> "entrate in rotatoria che hanno una strada laterale (non footway ecc...)"
> nel cui primo nodo è quindi utile aggiungere l'oobbligo di proseguire
> dritti per chi proviene dall'uscita della rotatoria.
>
> Risultano 1567 way.
> Ci sono dei falsi positivi ma anche molti casi interessanti, da correggere:
> http://www.openstreetmap.org/browse/node/2122715707
> http://www.openstreetmap.org/browse/node/806490
> http://www.openstreetmap.org/browse/node/2104491729
> http://www.openstreetmap.org/browse/node/130097211
> http://www.openstreetmap.org/browse/node/51524726
>
> File GPX:
> https://dl.dropbox.com/u/41550819/OSM/direzione_obbligata_mancante.gpx
>
> Se mi votate la fiducia, aggiungo le segnalazioni alla pagina nel prossimo
> aggiornamento.
>
>
> Ciao,
> Groppo
>
_______________________________________________
Talk-it mailing list
Talk-it@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-it

Rispondere a