Skip to content

Commit

Permalink
Update destinations OSM tags (#951)
Browse files Browse the repository at this point in the history
Updated dentists, doctors, hospitals, pharmacies, retail, and schools to incorporate alternate or new OSM tags.
  • Loading branch information
lalver1 authored Feb 26, 2024
1 parent e62b949 commit d5fe3b8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/analysis/connectivity/destinations/dentists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ INSERT INTO generated.neighborhood_dentists (
)
SELECT ST_Multi(ST_Buffer(ST_CollectionExtract(unnest(ST_ClusterWithin(way,:cluster_tolerance)),3),0))
FROM neighborhood_osm_full_polygon
WHERE amenity = 'dentist';
WHERE amenity = 'dentist' OR
healthcare = 'dentist';

-- set points on polygons
UPDATE generated.neighborhood_dentists
Expand All @@ -43,7 +44,8 @@ SELECT osm_id,
name,
way
FROM neighborhood_osm_full_point
WHERE amenity = 'dentist'
WHERE amenity = 'dentist' OR
healthcare = 'dentist'
AND NOT EXISTS (
SELECT 1
FROM neighborhood_dentists s
Expand Down
6 changes: 4 additions & 2 deletions src/analysis/connectivity/destinations/doctors.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ INSERT INTO generated.neighborhood_doctors (
)
SELECT ST_Multi(ST_Buffer(ST_CollectionExtract(unnest(ST_ClusterWithin(way,:cluster_tolerance)),3),0))
FROM neighborhood_osm_full_polygon
WHERE amenity IN ('clinic','doctors');
WHERE amenity IN ('clinic','doctors') OR
healthcare IN ('doctor','doctors','clinic');

-- set points on polygons
UPDATE generated.neighborhood_doctors
Expand All @@ -43,7 +44,8 @@ SELECT osm_id,
name,
way
FROM neighborhood_osm_full_point
WHERE amenity IN ('clinic','doctors')
WHERE amenity IN ('clinic','doctors') OR
healthcare IN ('doctor','doctors','clinic')
AND NOT EXISTS (
SELECT 1
FROM neighborhood_doctors s
Expand Down
6 changes: 4 additions & 2 deletions src/analysis/connectivity/destinations/hospitals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ INSERT INTO generated.neighborhood_hospitals (
)
SELECT ST_Multi(ST_Buffer(ST_CollectionExtract(unnest(ST_ClusterWithin(way,:cluster_tolerance)),3),0))
FROM neighborhood_osm_full_polygon
WHERE amenity IN ('hospitals','hospital');
WHERE amenity IN ('hospitals','hospital') OR
healthcare = 'hospital';

-- set points on polygons
UPDATE generated.neighborhood_hospitals
Expand All @@ -43,7 +44,8 @@ SELECT osm_id,
name,
way
FROM neighborhood_osm_full_point
WHERE amenity IN ('hospitals','hospital')
WHERE amenity IN ('hospitals','hospital') OR
healthcare = 'hospital'
AND NOT EXISTS (
SELECT 1
FROM neighborhood_hospitals s
Expand Down
6 changes: 4 additions & 2 deletions src/analysis/connectivity/destinations/pharmacies.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ INSERT INTO generated.neighborhood_pharmacies (
)
SELECT ST_Multi(ST_Buffer(ST_CollectionExtract(unnest(ST_ClusterWithin(way,:cluster_tolerance)),3),0))
FROM neighborhood_osm_full_polygon
WHERE amenity = 'pharmacy';
WHERE amenity = 'pharmacy' OR
shop = 'chemist';

-- set points on polygons
UPDATE generated.neighborhood_pharmacies
Expand All @@ -43,7 +44,8 @@ SELECT osm_id,
name,
way
FROM neighborhood_osm_full_point
WHERE amenity = 'pharmacy'
WHERE amenity = 'pharmacy' OR
shop = 'chemist'
AND NOT EXISTS (
SELECT 1
FROM neighborhood_pharmacies s
Expand Down
3 changes: 2 additions & 1 deletion src/analysis/connectivity/destinations/retail.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ INSERT INTO generated.neighborhood_retail (
)
SELECT ST_Multi(ST_Buffer(ST_CollectionExtract(unnest(ST_ClusterWithin(way,:cluster_tolerance)),3),0))
FROM neighborhood_osm_full_polygon
WHERE landuse = 'retail';
WHERE landuse = 'retail' OR
building = 'retail';

-- set points on polygons
UPDATE generated.neighborhood_retail
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/connectivity/destinations/schools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SELECT osm_id,
ST_Centroid(way),
way
FROM neighborhood_osm_full_polygon
WHERE amenity = 'school';
WHERE amenity IN ('school','kindergarten');

-- remove subareas that are mistakenly designated as amenity=school
DELETE FROM generated.neighborhood_schools
Expand All @@ -50,7 +50,7 @@ SELECT osm_id,
name,
way
FROM neighborhood_osm_full_point
WHERE amenity = 'school'
WHERE amenity IN ('school','kindergarten')
AND NOT EXISTS (
SELECT 1
FROM neighborhood_schools s
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/import/pfb.style
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ node amenity text linear
way amenity text polygon
node,way bicycle text linear
node,way bridge text linear
node,way building text polygon
node,way button_operated text linear
node,way crossing text linear
node,way crossing:island text linear
Expand All @@ -105,6 +106,7 @@ way cycleway:both:width text linear
node,way flashing_lights text linear
node,way foot text linear
way footway text linear
node,way healthcare text polygon
node,way highway text linear
node,way junction text linear
way landuse text linear,polygon
Expand Down

0 comments on commit d5fe3b8

Please sign in to comment.