Visitas: 2
Hace un momento me pidieron que determine todas las instituciones educativas de Paraguay (kindergarten, school, college y university).
Baje el archivo de OSM y coloque en una base de datos PostgreSQL/PostGIS y luego realice tres consultas para luego exportar a archivos csv.
Las consultas:
SELECT id, ST_X (ST_Transform (n.geom, 4326)) long, ST_Y (ST_Transform (n.geom, 4326)) lat, tags FROM nodes n WHERE n.tags->'amenity' = 'kindergarten' or n.tags->'building' = 'kindergarten'
or n.tags->'amenity' = 'school' or n.tags->'building' = 'school'
or n.tags->'amenity' = 'college' or n.tags->'building' = 'college'
or n.tags->'amenity' = 'university' or n.tags->'building' = 'university';
SELECT id, tags FROM ways n WHERE n.tags->'amenity' = 'kindergarten' or n.tags->'building' = 'kindergarten'
or n.tags->'amenity' = 'school' or n.tags->'building' = 'school'
or n.tags->'amenity' = 'college' or n.tags->'building' = 'college'
or n.tags->'amenity' = 'university' or n.tags->'building' = 'university';
SELECT id, tags FROM relations n WHERE n.tags->'amenity' = 'kindergarten' or n.tags->'building' = 'kindergarten'
or n.tags->'amenity' = 'school' or n.tags->'building' = 'school'
or n.tags->'amenity' = 'college' or n.tags->'building' = 'college'
or n.tags->'amenity' = 'university' or n.tags->'building' = 'university';