Skip to content

Commit

Permalink
Replace VMAP0-data by OSM-data
Browse files Browse the repository at this point in the history
Currently, we use VMAP0-data instead of OSM-data to indicate built-up areas
on zoom levels 8 and 9. This PR replaces the VMAP0-data with the OSM
landcover data.

Resolves #256.
  • Loading branch information
math1985 committed Dec 6, 2017
1 parent a75953a commit e280ffe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
8 changes: 4 additions & 4 deletions landcover.mss
Expand Up @@ -216,7 +216,7 @@
line-opacity: 0.329;
}

[feature = 'landuse_residential'][zoom >= 10] {
[feature = 'landuse_residential'][zoom >= 8] {
polygon-fill: @built-up-lower-lowzoom;
[zoom >= 11] { polygon-fill: @built-up-upper-lowzoom; }
[zoom >= 13] { polygon-fill: @residential; }
Expand Down Expand Up @@ -345,7 +345,7 @@

[feature = 'landuse_retail'],
[feature = 'amenity_marketplace'] {
[zoom >= 10] {
[zoom >= 8] {
polygon-fill: @built-up-lower-lowzoom;
[zoom >= 11] { polygon-fill: @built-up-upper-lowzoom; }
[zoom >= 13] { polygon-fill: @retail; }
Expand All @@ -361,7 +361,7 @@
}
}

[feature = 'landuse_industrial'][zoom >= 10] {
[feature = 'landuse_industrial'][zoom >= 8] {
polygon-fill: @built-up-lower-lowzoom;
[zoom >= 11] { polygon-fill: @built-up-upper-lowzoom; }
[zoom >= 13] { polygon-fill: @industrial; }
Expand Down Expand Up @@ -413,7 +413,7 @@
[way_pixels >= 64] { polygon-gamma: 0.3; }
}

[feature = 'landuse_commercial'][zoom >= 10] {
[feature = 'landuse_commercial'][zoom >= 8] {
polygon-fill: @built-up-lower-lowzoom;
[zoom >= 11] { polygon-fill: @built-up-upper-lowzoom; }
[zoom >= 13] { polygon-fill: @commercial; }
Expand Down
5 changes: 3 additions & 2 deletions project.mml
Expand Up @@ -101,12 +101,13 @@ Layer:
COALESCE(wetland, landuse, "natural") AS feature
FROM (SELECT
way, COALESCE(name, '') AS name, religion,
('landuse_' || (CASE WHEN landuse IN ('forest', 'military', 'farmland') THEN landuse ELSE NULL END)) AS landuse,
('landuse_' || (CASE WHEN landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial') THEN landuse ELSE NULL END)) AS landuse,
('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END)) AS "natural",
('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland,

way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse IN ('forest', 'military', 'farmland')
WHERE (landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial')
OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock'))
AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
AND building IS NULL
Expand Down
1 change: 0 additions & 1 deletion scripts/get-shapefiles.py
Expand Up @@ -41,7 +41,6 @@
'type': 'tgz',
'shp_basename': [
'world_bnd_m',
'builtup_area',
'places',
'world_boundaries_m'],
'long_opt': '--world-boundaries'
Expand Down
6 changes: 0 additions & 6 deletions shapefiles.mss
Expand Up @@ -45,9 +45,3 @@
}
}
}

#builtup {
[zoom >= 8][zoom < 10] {
polygon-fill: #ddd;
}
}

0 comments on commit e280ffe

Please sign in to comment.