diff --git a/tilemaker/resources/process-openmaptiles.lua b/tilemaker/resources/process-openmaptiles.lua index de68070..98d8197 100644 --- a/tilemaker/resources/process-openmaptiles.lua +++ b/tilemaker/resources/process-openmaptiles.lua @@ -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") @@ -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 @@ -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 @@ -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