[OSM-talk-fr] [SQL] Communes sans rue

Vincent Pottier vpottier at gmail.com
Sam 7 Aou 07:25:20 UTC 2010


Bonjour,
Ayant réussi à réinstaller postgis en local, j'ai testé une requête pour 
trouver les communes sans rue.
J'en trouve près de 9300, mais il y a des faux positifs.
Je mets la requête pour amélioration avant que ça devienne un module 
genre osmose.

SELECT      c.osm_id,
             c."ref:INSEE",
             c.name,
             ST_AsText(ST_Centroid(c.way))
FROM        france_polygon AS c
                 LEFT OUTER JOIN france_roads AS r
                     ON ( r.highway='residential'
                            OR r.highway='unclassified'
                            OR r.highway='tertiary'
                            OR r.highway='secondary'
                            )
                        AND (
                            ST_Intersects(c.way, r.way)
                            OR ST_Contains(c.way, r.way)
                            )
WHERE c.admin_level='8'
     AND r.osm_id IS NULL
ORDER BY c."ref:INSEE"
--
FrViPofm




Plus d'informations sur la liste de diffusion Talk-fr