Skip to content

Commit

Permalink
Add dam layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakaner committed Jan 16, 2023
1 parent 981aee9 commit e750e09
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
15 changes: 15 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@
"simplify_ratio": 2,
"combine_below": 15
},
"dam_lines": {
"minzoom": 12,
"maxzoom": 14,
"simplify_below": 14,
"simplify_level": 0.0001,
"simplify_ratio": 2,
"combine_below": 15
},
"dam_polygons": {
"minzoom": 12,
"maxzoom": 14,
"simplify_below": 14,
"simplify_level": 0.0001,
"simplify_ratio": 2
},
"pier_lines": {
"minzoom": 12,
"maxzoom": 14,
Expand Down
19 changes: 16 additions & 3 deletions process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -807,14 +807,25 @@ function process_ferries(way)
end

function process_bridges(way)
local mz = inf_zoom
if way:Find("man_made") == "bridge" then
way:Layer("bridges", true)
way:MinZoom(12)
way:Attribute("kind", "bridge")
end
end

function process_dam(way, polygon)
if way:Find("waterway") == "dam" then
if polygon then
way:Layer("dam_polygons", true)
else
way:Layer("dam_lines", false)
end
way:MinZoom(12)
way:Attribute("kind", "dam")
end
end

function way_function(way)
local area = way:Area()
local area_tag = way:Find("area")
Expand All @@ -827,13 +838,15 @@ function way_function(way)
-- If closed ways are assumed to be rings by default except tagged with area=yes, type=multipolygon or type=boundary
local is_area_default_linear = area > 0 and (area_tag == "yes" or type_tag == "multipolygon" or type_tag == "boundary")

-- Layers water_polygons, water_polygons_labels
-- Layers water_polygons, water_polygons_labels, dam_polygons
if is_area and (way:Holds("waterway") or way:Holds("natural") or way:Holds("landuse")) then
process_water_polygons(way)
process_dam(way, true)
end
-- Layers water_lines, water_lines_labels
-- Layers water_lines, water_lines_labels, dam_lines
if not is_area and way:Holds("waterway") then
process_water_lines(way)
process_dam(way, false)
end

-- Layer pier_lines, pier_polygons
Expand Down
14 changes: 13 additions & 1 deletion tilestats.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tilestats": {
"layerCount": 19,
"layerCount": 22,
"layers": [
{
"layer": "place_labels",
Expand All @@ -26,6 +26,14 @@
"layer": "water_lines_labels",
"geometry": "LineString"
},
{
"layer": "dam_lines",
"geometry": "LineString"
},
{
"layer": "dam_polygons",
"geometry": "Polygon"
},
{
"layer": "pier_lines",
"geometry": "LineString"
Expand All @@ -34,6 +42,10 @@
"layer": "pier_polygons",
"geometry": "Polygon"
},
{
"layer": "bridges",
"geometry": "Polygon"
},
{
"layer": "streets",
"geometry": "LineString"
Expand Down

0 comments on commit e750e09

Please sign in to comment.