Skip to content

Commit

Permalink
Merge pull request #4100 from jeisenbe/admin-rework
Browse files Browse the repository at this point in the history
Rework admin boundaries and show admin_level=5/6/7 sooner, level=10 later
  • Loading branch information
jeisenbe authored Apr 10, 2020
2 parents e7fc0c9 + 0bebd11 commit fc69dbf
Show file tree
Hide file tree
Showing 3 changed files with 430 additions and 98 deletions.
31 changes: 29 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ Layer:
) AS admin_low_zoom
properties:
minzoom: 4
maxzoom: 10
maxzoom: 7
- id: admin-mid-zoom
geometry: linestring
<<: *extents
Expand All @@ -1059,7 +1059,7 @@ Layer:
ORDER BY admin_level DESC
) AS admin_mid_zoom
properties:
minzoom: 11
minzoom: 8
maxzoom: 12
- id: admin-high-zoom
geometry: linestring
Expand Down Expand Up @@ -1198,6 +1198,7 @@ Layer:
ST_PointOnSurface(way) AS way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
name,
admin_level,
ref
FROM planet_osm_polygon
WHERE way && !bbox!
Expand Down Expand Up @@ -1394,6 +1395,31 @@ Layer:
) AS bridge_text
properties:
minzoom: 11
- id: county-names
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
ST_PointOnSurface(way) AS way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
name,
admin_level
FROM planet_osm_polygon
WHERE way && !bbox!
AND boundary = 'administrative'
AND admin_level IN ('5', '6')
AND name IS NOT NULL
AND way_area > 12000*POW(!scale_denominator!*0.001*0.28,2)
AND way_area < 196000*POW(!scale_denominator!*0.001*0.28,2)
AND osm_id < 0
ORDER BY
admin_level,
way_area DESC
) AS county_names
properties:
minzoom: 8
- id: amenity-points
geometry: point
<<: *extents
Expand Down Expand Up @@ -2106,6 +2132,7 @@ Layer:
AND admin_level IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10')
AND name IS NOT NULL
AND osm_id < 0
AND way_area > 196000*POW(!scale_denominator!*0.001*0.28,2)
ORDER BY admin_level::integer ASC, way_area DESC
) AS admin_text
properties:
Expand Down
Loading

0 comments on commit fc69dbf

Please sign in to comment.