Skip to content

Commit

Permalink
Include springs,passes,peaks with no ele tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Barron committed Jan 15, 2020
1 parent bce9be6 commit ba184ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 6 additions & 4 deletions layers/mountain_peak/layer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ $$
row_number() OVER (
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
ORDER BY (
substring(ele from E'^(-?\\d+)(\\D|$)')::int +
(CASE WHEN ele is not null AND ele ~ E'^-?\\d{1,4}(\\D|$)' THEN substring(ele from E'^(-?\\d+)(\\D|$)')::int ELSE 0 END) +
(CASE WHEN NULLIF(wikipedia, '') is not null THEN 10000 ELSE 0 END) +
(CASE WHEN NULLIF(name, '') is not null THEN 10000 ELSE 0 END)
) DESC
)::int AS "rank"
FROM osm_peak_point
WHERE geometry && bbox
AND ele is not null
AND ele ~ E'^-?\\d{1,4}(\\D|$)'
) AS ranked_peaks
WHERE zoom_level >= 7 AND (rank <= 5 OR zoom_level >= 14)
WHERE
(zoom_level >= 7 AND rank <= 1 AND ele is not null) OR
(zoom_level >= 9 AND rank <= 3 AND ele is not null) OR
(zoom_level >= 11 AND rank <= 5 AND ele is not null) OR
(zoom_level >= 14)
ORDER BY "rank" ASC;

$$ LANGUAGE SQL IMMUTABLE;
6 changes: 0 additions & 6 deletions layers/poi/mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ def_poi_mapping_leisure: &poi_mapping_leisure
- swimming_pool
- water_park

# natural values: see http://taginfo.openstreetmap.org/keys/natural#values
def_poi_mapping_natural: &poi_mapping_natural
- spring
- saddle

# railway values , see http://taginfo.openstreetmap.org/keys/railway#values
def_poi_mapping_railway: &poi_mapping_railway
- halt
Expand Down Expand Up @@ -377,7 +372,6 @@ def_poi_mapping: &poi_mapping
historic: *poi_mapping_historic
landuse: *poi_mapping_landuse
leisure: *poi_mapping_leisure
natural: *poi_mapping_natural
railway: *poi_mapping_railway
shop: *poi_mapping_shop
sport: *poi_mapping_sport
Expand Down

0 comments on commit ba184ae

Please sign in to comment.