Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add natural and man_made pois #658

Merged
merged 1 commit into from
Apr 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion data/migrations/v0.10.0-point.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ WHERE
amenity = 'boat_rental' OR
shop = 'boat_rental' OR
tags->'rental' = 'boat' OR
(shop = 'boat' AND tags->'rental' = 'yes');
(shop = 'boat' AND tags->'rental' = 'yes') OR
man_made IN ('beacon', 'cross', 'mineshaft', 'adit', 'water_well') OR
"natural" IN ('saddle', 'dune', 'geyser', 'sinkhole', 'hot_spring', 'rock', 'stone');

-- create index if it doesn't already exist.
DO $$
Expand Down
4 changes: 3 additions & 1 deletion data/migrations/v0.10.0-polygon.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ WHERE
amenity = 'boat_rental' OR
shop = 'boat_rental' OR
tags->'rental' = 'boat' OR
(shop = 'boat' AND tags->'rental' = 'yes');
(shop = 'boat' AND tags->'rental' = 'yes') OR
man_made IN ('beacon', 'cross', 'mineshaft', 'adit', 'water_well') OR
"natural" IN ('saddle', 'dune', 'geyser', 'sinkhole', 'hot_spring', 'rock', 'stone');
2 changes: 1 addition & 1 deletion docs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Implied but not stated: `source`: `openstreetmap.org`.

**POI kind values:**

* `accountant`, `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`, `beach`, `bed_and_breakfast`, `bench`, `bicycle_parking`, `bicycle_rental`, `bicycle`, `biergarten`, `block`, `boat_rental`, `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`, `clothes`, `club`, `college`, `community_centre`, `company`, `computer`, `confectionery`, `consulting`, `convenience`, `courthouse`, `dairy_kitchen`, `day_care`, `dentist`, `department_store`, `doctors`, `doityourself`, `dressmaker`, `drinking_water`, `dry_cleaning`, `educational_institution`, `electrician`, `electronics`, `embassy`, `emergency_phone`, `employment_agency`, `enclosure`, `estate_agent`, `fashion`, `fast_food`, `ferry_terminal`, `financial`, `fire_station`, `fitness_station`, `fitness`, `florist`, `food_bank`, `ford`, `foundation`, `fuel`, `gardener`, `gate`, `generator`, `gift`, `government`, `greengrocer`, `group_home`, `guest_house`, `hairdresser`, `halt`, `hanami`, `handicraft`, `hardware`, `healthcare`, `helipad`, `hospital`, `hostel`, `hotel`, `hvac`, `ice_cream`, `information`, `insurance`, `it`, `jewelry`, `kindergarten`, `landmark`, `laundry`, `lawyer`, `level_crossing`, `library`, `lift_gate`, `lighthouse`, `lock`, `mall`, `marina`, `mast`, `maze`, `memorial`, `metal_construction`, `midwife`, `mini_roundabout`, `mobile_phone`, `motel`, `motorway_junction`, `museum`, `music`, `newspaper`, `ngo`, `notary`, `nursing_home`, `nursing_home`, `optician`, `outreach`, `painter`, `parking`, `peak`, `pet`, `petting_zoo`, `pharmacy`, `phone`, `photographer`, `photographic_laboratory`, `physician`, `picnic_site`, `place_of_worship`, `playground`, `plumber`, `police`, `political_party`, `post_box`, `post_office`, `pottery`, `power_wind`, `prison`, `pub`, `recycling`, `refugee_camp`, `religion`, `research`, `residential_home`, `resort`, `restaurant`, `roller_coaster`, `sawmill`, `school`, `shelter`, `shelter`, `shoemaker`, `ski_rental`, `ski_school`, `ski`, `slipway`, `snow_cannon`, `social_facility`, `soup_kitchen`, `sports_centre`, `sports`, `spring`, `stadium`, `station`, `stonemason`, `subway_entrance`, `summer_toboggan`, `supermarket`, `tailor`, `tax_advisor`, `telecommunication`, `telephone`, `theatre`, `theme_park`, `therapist`, `toilets`, `toilets`, `townhall`, `toys`, `trade`, `traffic_signals`, `trail_riding_station`, `tram_stop`, `travel_agent`, `tree`, `university`, `veterinary`, `viewpoint`, `volcano`, `waste_basket`, `water_slide`, `water_tower`, `wilderness_hut`, `wildlife_park`, `windmill`, `wine`, `winery`, `workshop`, `yes`, `zoo`.
* `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`, `beach`, `beacon`, `bed_and_breakfast`, `bench`, `bicycle_parking`, `bicycle_rental`, `bicycle`, `biergarten`, `block`, `boat_rental`, `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`, `clothes`, `club`, `college`, `community_centre`, `company`, `computer`, `confectionery`, `consulting`, `convenience`, `courthouse`, `cross`, `dairy_kitchen`, `day_care`, `dentist`, `department_store`, `doctors`, `doityourself`, `dressmaker`, `drinking_water`, `dry_cleaning`, `dune`, `educational_institution`, `electrician`, `electronics`, `embassy`, `emergency_phone`, `employment_agency`, `enclosure`, `estate_agent`, `fashion`, `fast_food`, `ferry_terminal`, `financial`, `fire_station`, `fitness_station`, `fitness`, `florist`, `food_bank`, `ford`, `foundation`, `fuel`, `gardener`, `gate`, `generator`, `geyser`, `gift`, `government`, `greengrocer`, `group_home`, `guest_house`, `hairdresser`, `halt`, `hanami`, `handicraft`, `hardware`, `healthcare`, `helipad`, `hospital`, `hostel`, `hotel`, `hot_spring`, `hvac`, `ice_cream`, `information`, `insurance`, `it`, `jewelry`, `kindergarten`, `landmark`, `laundry`, `lawyer`, `level_crossing`, `library`, `lift_gate`, `lighthouse`, `lock`, `mall`, `marina`, `mast`, `maze`, `memorial`, `metal_construction`, `midwife`, `mineshaft`, `mini_roundabout`, `mobile_phone`, `motel`, `motorway_junction`, `museum`, `music`, `newspaper`, `ngo`, `notary`, `nursing_home`, `nursing_home`, `optician`, `outreach`, `painter`, `parking`, `peak`, `pet`, `petting_zoo`, `pharmacy`, `phone`, `photographer`, `photographic_laboratory`, `physician`, `picnic_site`, `place_of_worship`, `playground`, `plumber`, `police`, `political_party`, `post_box`, `post_office`, `pottery`, `power_wind`, `prison`, `pub`, `recycling`, `refugee_camp`, `religion`, `research`, `residential_home`, `resort`, `restaurant`, `rock`, `roller_coaster`, `saddle`, `sawmill`, `school`, `shelter`, `shelter`, `shoemaker`, `sinkhole`, `ski_rental`, `ski_school`, `ski`, `slipway`, `snow_cannon`, `social_facility`, `soup_kitchen`, `sports_centre`, `sports`, `spring`, `stadium`, `station`, `stone`, `stonemason`, `subway_entrance`, `summer_toboggan`, `supermarket`, `tailor`, `tax_advisor`, `telecommunication`, `telephone`, `theatre`, `theme_park`, `therapist`, `toilets`, `toilets`, `townhall`, `toys`, `trade`, `traffic_signals`, `trail_riding_station`, `tram_stop`, `travel_agent`, `tree`, `university`, `veterinary`, `viewpoint`, `volcano`, `waste_basket`, `water_slide`, `water_tower`, `water_well`, `wilderness_hut`, `wildlife_park`, `windmill`, `wine`, `winery`, `workshop`, `yes`, `zoo`.

## Roads (Transportation)

Expand Down
7 changes: 7 additions & 0 deletions spreadsheets/kind/pois.csv
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,10 @@ station,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${13},station
*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,bed_and_breakfast;chalet;guest_house;hostel,*,${17},${tourism}
*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,subway_entrance,*,*,*,*,*,*,*,*,*,*,*,${17},subway_entrance
*,*,bench;waste_basket,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${18},${amenity}
*,*,*,*,*,*,*,*,*,*,*,beacon;cross;mineshaft,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${15},${man_made}
*,*,*,*,*,*,*,*,*,*,*,adit,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${16},adit
*,*,*,*,*,*,*,*,*,*,*,water_well,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${17},water_well
*,*,*,*,*,*,*,*,*,*,*,*,saddle,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${14},saddle
*,*,*,*,*,*,*,*,*,*,*,*,dune;geyser;sinkhole,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${15},"${""natural""}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the "" around {""natural""} do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to quote the column name natural as "natural" because natural is a keyword in SQL, and the double-quotes means it can be used as a column or table name. The ${} around it is our way of quoting literals in the CSV generation, and the expansion into "${""natural""}" comes from the CSV itself: because it contains a quote, it must be quoted, and the original quotes are expanded to two consecutive sets each.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

*,*,*,*,*,*,*,*,*,*,*,*,hot_spring,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${16},hot_spring
*,*,*,*,*,*,*,*,*,*,*,*,rock;stone,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,${17},"${""natural""}"
34 changes: 34 additions & 0 deletions test/657-natural-man_made.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# node 1328665285
assert_has_feature(
15, 5293, 12734, 'pois',
{ 'kind': 'mineshaft' })

# node 1071144152
assert_has_feature(
16, 10583, 25289, 'pois',
{ 'kind': 'adit' })

# node 2794798164
assert_has_feature(
16, 10549, 25431, 'pois',
{ 'kind': 'water_well', 'min_zoom': 17 })

# node 966585438
assert_has_feature(
14, 2764, 6333, 'pois',
{ 'kind': 'saddle' })

# node 358832354
assert_has_feature(
15, 5224, 12570, 'pois',
{ 'kind': 'geyser' })

# node 4020311689
assert_has_feature(
16, 10805, 25827, 'pois',
{ 'kind': 'hot_spring' })

# node 3150154140
assert_has_feature(
16, 10482, 25294, 'pois',
{ 'kind': 'rock', 'min_zoom': 17 })