Skip to content

Commit

Permalink
Merge pull request #1447 from pnorman/1425_shops
Browse files Browse the repository at this point in the history
Add shops from osm.org and iD
  • Loading branch information
pnorman authored Dec 12, 2017
2 parents 1c6c0c6 + eea559a commit a9ae281
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 4 deletions.
8 changes: 8 additions & 0 deletions data/migrations/v1.5.0-planet_osm_point.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-- Add new shop types
UPDATE planet_osm_point
SET mz_poi_min_zoom = mz_calculate_min_zoom_pois(planet_osm_point.*)
WHERE mz_poi_min_zoom <> mz_calculate_min_zoom_pois(planet_osm_polygon.*)
AND shop in ('art', 'beauty', 'coffee', 'deli', 'furniture', 'hifi',
'newsagent', 'perfumery', 'shoes', 'stationery', 'tobacco', 'travel_agency',
'variety_store');

-- ladder the point indexes
SET client_min_messages TO WARNING;
CREATE INDEX IF NOT EXISTS
Expand Down
7 changes: 7 additions & 0 deletions data/migrations/v1.5.0-planet_osm_polygon.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-- Add new shop types
UPDATE planet_osm_polygon
SET mz_poi_min_zoom = mz_calculate_min_zoom_pois(planet_osm_polygon.*)
WHERE shop in ('art', 'beauty', 'coffee', 'deli', 'furniture', 'hifi',
'newsagent', 'perfumery', 'shoes', 'stationery', 'tobacco', 'travel_agency',
'variety_store');

-- polygon low zoom
SET client_min_messages TO WARNING;
CREATE INDEX IF NOT EXISTS
Expand Down
15 changes: 14 additions & 1 deletion docs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o

#### POI `kind` values:

* `art`
* `accountant`
* `adit`
* `administrative`
Expand Down Expand Up @@ -720,6 +721,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `beach_resort`
* `beach`
* `beacon`
* `beauty`
* `bed_and_breakfast`
* `bench`
* `bicycle_parking`
Expand Down Expand Up @@ -757,6 +759,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `closed`. _See planned bug fix in [#1026](https://github.com/tilezen/vector-datasource/issues/1026)._
* `clothes`
* `club`
* `coffee`
* `college`
* `communications_tower`
* `community_centre`
Expand All @@ -771,6 +774,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `dairy_kitchen`
* `dam`
* `day_care`
* `deli`
* `dentist`
* `department_store`
* `dive_centre`
Expand All @@ -790,9 +794,9 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `employment_agency`
* `enclosure` - at a zoo
* `estate_agent`
* `farm`
* `fashion`
* `fast_food`
* `farm`
* `ferry_terminal`
* `financial`
* `fire_station` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
Expand All @@ -808,6 +812,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `fort`
* `foundation`
* `fuel` - Fuel stations provide liquid gas (or diesel) for automotive use.
* `furniture`
* `gallery` - An art gallery.
* `garden` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `gardener`
Expand All @@ -829,6 +834,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `hazard`
* `healthcare`
* `helipad`
* `hifi`
* `historical`_See planned bug fix in [#1026](https://github.com/tilezen/vector-datasource/issues/1026)._
* `hospital`
* `hostel`
Expand Down Expand Up @@ -871,6 +877,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `music`
* `national_park`
* `nature_reserve`
* `newsagent`
* `newspaper`
* `ngo`
* `notary`
Expand All @@ -884,6 +891,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `park` - _See planned bug fixes in [#1081](https://github.com/tilezen/vector-datasource/issues/1081)._
* `parking` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
* `peak` A mountain peak. See above for properties available on peaks and volcanos.
* `perfumery`
* `pet`
* `petroleum_well`
* `petting_zoo`
Expand Down Expand Up @@ -935,6 +943,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `service_area`
* `shelter`
* `shoemaker`
* `shoes`
* `shower`
* `sinkhole`
* `ski_rental`
Expand All @@ -949,6 +958,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `spring`
* `stadium`
* `station` - _See planned bug fix in [#532](https://github.com/tilezen/vector-datasource/issues/532)._
* `stationery`
* `stone`
* `stonemason`
* `substation` - _See planned bug fixes in [#1085](https://github.com/tilezen/vector-datasource/issues/1085)._
Expand All @@ -965,6 +975,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `theatre`
* `theme_park`
* `therapist`
* `tobacco`
* `toilets`
* `toll_booth`
* `townhall`
Expand All @@ -974,9 +985,11 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o
* `trail_riding_station`
* `trailhead`
* `tram_stop`
* `travel_agency`
* `travel_agent`
* `tree`
* `university`
* `variety_store`
* `veterinary`
* `viewpoint`
* `volcano` The peak of a volcano. See above for properties available on peaks and volcanos.
Expand Down
53 changes: 53 additions & 0 deletions integration-test/1425-osm-features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from . import FixtureTest


class FeatureTests(FixtureTest):

def test_shops(self):
self._run_poi_test(
'http://www.openstreetmap.org/node/2178336349',
'16/19299/24638', {'kind': 'art'})
self._run_poi_test(
'http://www.openstreetmap.org/node/2821335218',
'16/19295/24639', {'kind': 'beauty'})
self._run_poi_test(
'http://www.openstreetmap.org/node/4995839495',
'16/19307/24631', {'kind': 'coffee'})
self._run_poi_test(
'http://www.openstreetmap.org/node/3842837139',
'16/19301/24630', {'kind': 'deli'})
self._run_poi_test(
'http://www.openstreetmap.org/node/2328279410',
'16/19296/24633', {'kind': 'furniture'})
self._run_poi_test(
'http://www.openstreetmap.org/node/2898340720',
'16/19313/24633', {'kind': 'hifi'})
self._run_poi_test(
'http://www.openstreetmap.org/node/1581176007',
'16/19301/24632', {'kind': 'newsagent'})
self._run_poi_test(
'http://www.openstreetmap.org/node/4913377716',
'16/19298/24629', {'kind': 'perfumery'})
self._run_poi_test(
'http://www.openstreetmap.org/node/1853451180',
'16/19296/24633', {'kind': 'shoes'})
self._run_poi_test(
'http://www.openstreetmap.org/node/3676902925',
'16/19299/24635', {'kind': 'stationery'})
self._run_poi_test(
'http://www.openstreetmap.org/node/3116856932',
'16/19304/24626', {'kind': 'tobacco'})
self._run_poi_test(
'http://www.openstreetmap.org/node/4553346149',
'16/19298/24632', {'kind': 'travel_agency'})
self._run_poi_test(
'http://www.openstreetmap.org/node/2299770718',
'16/19297/24633', {'kind': 'variety_store'})

def _run_test(self, url, zxy, layer, props):
z, x, y = map(int, zxy.split('/'))
self.load_fixtures([url])
self.assert_has_feature(z, x, y, layer, props)

def _run_poi_test(self, url, zxy, props):
return self._run_test(url, zxy, 'pois', props)
2 changes: 1 addition & 1 deletion tilejson/tilejson.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"name" : "String. Localized name variants are in properties like 'name:en'. Common value.",
"id" : "Integer. Common value.",
"source" : "String. Common value, one of: openstreetmap.org.",
"kind" : "String. One value of: accountant, adit, administrative, advertising_agency, aerodrome, airport, alcohol, alpine_hut, ambulatory_care, amusement_ride, animal, aquarium, archaeological_site, architect, are_home, artwork, assisted_living, association, atm, attraction, aviary, bakery, bank, bar, battlefield, bbq, beach_resort, beach, beacon, bed_and_breakfast, bench, bicycle_parking, bicycle_rental, bicycle_rental_station, bicycle_repair_station, bicycle, bicycle_junction, biergarten, block, boat_rental, boat_storage, bollard, books, brewery, bus_station, bus_stop, butcher, cafe, camp_site, car_repair, car_sharing, car, caravan_site, carousel, carpenter, cave_entrance, chalet, childcare, childrens_centre, cinema, clinic, closed, clothes, club, college, communications_tower, community_centre, company, computer, confectionery, consulting, convenience, courthouse, cross, cycle_barrier, dairy_kitchen, dam, day_care, dentist, department_store, dive_centre, doctors, dog_park, doityourself, dressmaker, drinking_water, dry_cleaning, dune, educational_institution, egress, electrician, electronics, embassy, emergency_phone, employment_agency, enclosure, estate_agent, fashion, fast_food, ferry_terminal, financial, fire_station, firepit, fishing, fishing_area, fitness_station, fitness, florist, food_bank, ford, fort, foundation, fuel, garden, gardener, gas_canister, gate, generator, geyser, gift, government, greengrocer, group_home, guest_house, hairdresser, halt, hanami, handicraft, hardware, hazard, healthcare, helipad, historical, hospital, hostel, hot_spring, hotel, hunting, hvac, ice_cream, information, insurance, it, jewelry, kindergarten, landmark, laundry, lawyer, level_crossing, library, life_ring, lifeguard_tower, lift_gate, lighthouse, lock, mall, marina, mast, maze, memorial, metal_construction, midwife, mineshaft, mini_roundabout, mobile_phone, monument, motel, motorcycle, motorway_junction, museum, music, newspaper, ngo, notary, nursing_home, observatory, offshore_platform, optician, outdoor, outreach, painter, parking, peak, pet, petroleum_well, petting_zoo, pharmacy, phone, photographer, photographic_laboratory, physician, picnic_site, picnic_table, place_of_worship, playground, plumber, police, political_party, post_box, post_office, pottery, power_pole, power_tower, power_wind, prison, pub, put_in_egress, put_in, pylon, ranger_station, rapid, recreation_track, recycling, refugee_camp, religion, research, residential_home, resort, rest_area, restaurant, rock, roller_coaster, saddle, sawmill, school, scuba_diving, service_area, shelter, shoemaker, shower, sinkhole, ski_rental, ski_school, ski, slipway, snow_cannon, social_facility, soup_kitchen, sports_centre, sports, spring, stadium, station, stone, stonemason, subway_entrance, summer_camp, summer_toboggan, supermarket, swimming_area, tailor, tax_advisor, telecommunication, telephone, telescope, theatre, theme_park, therapist, toilets, toll_booth, townhall, toys, trade, traffic_signals, trail_riding_station, trailhead, tram_stop, travel_agent, tree, university, veterinary, viewpoint, volcano, walking_junction, waste_basket, waste_disposal, water_park, water_point, water_slide, water_tower, water_well, waterfall, watering_place, wilderness_hut, wildlife_park, windmill, wine, winery, workshop, zoo.",
"kind" : "String. One value of: art, accountant, adit, administrative, advertising_agency, aerodrome, airport, alcohol, alpine_hut, ambulatory_care, amusement_ride, animal, aquarium, archaeological_site, architect, are_home, artwork, assisted_living, association, atm, attraction, aviary, bakery, bank, bar, battlefield, bbq, beach_resort, beach, beacon, bed_and_breakfast, bench, bicycle_parking, bicycle_rental, bicycle_rental_station, bicycle_repair_station, bicycle, bicycle_junction, biergarten, block, boat_rental, boat_storage, bollard, books, brewery, bus_station, bus_stop, butcher, cafe, camp_site, car_repair, car_sharing, car, caravan_site, carousel, carpenter, cave_entrance, chalet, childcare, childrens_centre, cinema, clinic, closed, clothes, club, coffee, college, communications_tower, community_centre, company, computer, confectionery, consulting, convenience, courthouse, cross, cycle_barrier, dairy_kitchen, dam, day_care, deli, dentist, department_store, dive_centre, doctors, dog_park, doityourself, dressmaker, drinking_water, dry_cleaning, dune, educational_institution, egress, electrician, electronics, embassy, emergency_phone, employment_agency, enclosure, estate_agent, farm, fashion, fast_food, ferry_terminal, financial, fire_station, firepit, fishing, fishing_area, fitness_station, fitness, florist, food_bank, ford, fort, foundation, fuel, furniture, garden, gardener, gas_canister, gate, generator, geyser, gift, government, greengrocer, group_home, guest_house, hairdresser, halt, hanami, handicraft, hardware, hazard, healthcare, helipad, hifi, historical, hospital, hostel, hot_spring, hotel, hunting, hvac, ice_cream, information, insurance, it, jewelry, kindergarten, landmark, laundry, lawyer, level_crossing, library, life_ring, lifeguard_tower, lift_gate, lighthouse, lock, mall, marina, mast, maze, memorial, metal_construction, midwife, mineshaft, mini_roundabout, mobile_phone, monument, motel, motorcycle, motorway_junction, museum, music, newspaper, newsagent, ngo, notary, nursing_home, observatory, offshore_platform, optician, outdoor, outreach, painter, parking, peak, perfumery, pet, petroleum_well, petting_zoo, pharmacy, phone, photographer, photographic_laboratory, physician, picnic_site, picnic_table, place_of_worship, playground, plumber, police, political_party, post_box, post_office, pottery, power_pole, power_tower, power_wind, prison, pub, put_in_egress, put_in, pylon, ranger_station, rapid, recreation_track, recycling, refugee_camp, religion, research, residential_home, resort, rest_area, restaurant, rock, roller_coaster, saddle, sawmill, school, scuba_diving, service_area, shelter, shoemaker, shoes, shower, sinkhole, ski_rental, ski_school, ski, slipway, snow_cannon, social_facility, soup_kitchen, sports_centre, sports, spring, stadium, station, stationery, stone, stonemason, subway_entrance, summer_camp, summer_toboggan, supermarket, swimming_area, tailor, tax_advisor, telecommunication, telephone, telescope, theatre, theme_park, therapist, tobacco, toilets, toll_booth, townhall, toys, trade, traffic_signals, trail_riding_station, trailhead, tram_stop, travel_agency, travel_agent, tree, university, veterinary, viewpoint, volcano, walking_junction, waste_basket, waste_disposal, water_park, water_point, water_slide, water_tower, water_well, waterfall, watering_place, wilderness_hut, wildlife_park, windmill, wine, winery, workshop, zoo.",
"aeroway" : "String. Common optional value.",
"attraction" : "String. Common optional value.",
"cuisine" : "String. Common optional value.",
Expand Down
18 changes: 16 additions & 2 deletions yaml/pois.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,12 @@ filters:
<<: *output_properties
kind: {col: amenity}
kind_detail: {col: cuisine}
- filter:
shop: [coffee, deli]
min_zoom: { clamp: { min: 0, max: 17, value: { sum: [ { col: zoom }, 2.5 ] } } }
output:
<<: *output_properties
kind: {col: shop}
- filter:
amenity: [pharmacy, veterinary]
min_zoom: { clamp: { min: 0, max: 17, value: { sum: [ { col: zoom }, 3.3 ] } } }
Expand All @@ -769,6 +775,12 @@ filters:
output:
<<: *output_properties
kind: {col: craft}
- filter:
shop: [variety_store, furniture, shoes, pet]
min_zoom: { clamp: { min: 0, max: 17, value: { sum: [ { col: zoom }, 3.3 ] } } }
output:
<<: *output_properties
kind: {col: shop}
- filter: {amenity: nursing_home}
min_zoom: { clamp: { min: 0, max: 16, value: { sum: [ { col: zoom }, 1.25 ] } } }
output:
Expand Down Expand Up @@ -1360,8 +1372,10 @@ filters:
<<: *output_properties
kind: cycle_barrier
- filter:
shop: [bakery, books, butcher, car, car_repair, clothes, computer, convenience,
fashion, florist, gift, greengrocer, hairdresser, jewelry, mobile_phone, optician, pet]
shop: [art, bakery, beauty, books, butcher, car, car_repair, clothes,
computer, convenience, fashion, florist, gift, greengrocer,
hairdresser, hifi, jewelry, mobile_phone, newsagent, optician,
perfumery, stationery, tobacco, travel_agency]
min_zoom: 17
output:
<<: *output_properties
Expand Down

0 comments on commit a9ae281

Please sign in to comment.