Skip to content
Open
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
34 changes: 31 additions & 3 deletions tilemaker/resources/process-openmaptiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ function node_function()

-- Write 'poi'
local rank, class, subclass = GetPOIRank()
if rank then WritePOI(class,subclass,rank,'n') end
local access = Find("access")
if rank and not isHiddenPrivatePOI() then
WritePOI(class,subclass,rank,'n')
end

-- Write 'mountain_peak' and 'water_name'
local natural = Find("natural")
Expand Down Expand Up @@ -687,6 +690,7 @@ function way_function()
end

-- Set 'water'
-- (therefore leisure==swimming_pool are only added in this water layer and not in the poi layer )
if natural=="water" or leisure=="swimming_pool" or landuse=="reservoir" or landuse=="basin" or waterClasses[waterway] then
if Find("covered")=="yes" or not is_closed then return end
local class="lake"; if waterway~="" then class="river" end
Expand Down Expand Up @@ -758,8 +762,12 @@ function way_function()
local rank, class, subclass = GetPOIRank()

local isRelation = IsMultiPolygon()
local nwr = isRelation and 'r' or 'w'
if rank then WritePOI(class,subclass,rank, nwr); return end
local nwr = isRelation and 'r' or 'w'
local access = Find("access")
if rank and not isHiddenPrivatePOI() then
WritePOI(class,subclass,rank, nwr)
return
end

-- Catch-all
if (building~="" or write_name) and Holds("name") then
Expand Down Expand Up @@ -985,6 +993,26 @@ function SetZOrder()
ZOrder(zOrder)
end

-- function to list the private POI which need to be removed from the POI layer
function isHiddenPrivatePOI()
local access = Find("access")
if access == "private" or access == "no" then
--key amenity
local amenity = Find("amenity")
if amenity == "parking" then return true end
--key leisure (swimming_pool not listed here since they are not in the POI layer but only their geometries in the water layer)
local leisure = Find("leisure")
if leisure == "garden" then return true end
if leisure == "pitch" then return true end
if leisure == "playground" then return true end
--key sport
local sport = Find("sport")
if sport == "tennis" then return true end
if sport == "swimming" then return true end
end
return false
end

-- ==========================================================
-- Lua utility functions

Expand Down