This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package.path = package.path .. ";/processing/topics/helper/?.lua" | ||
require('RemoveNilValues') | ||
RoadTodo = {} | ||
RoadTodo.__index = RoadTodo | ||
|
||
-- @param args table | ||
-- @param args.key string | ||
-- @param args.desc string | ||
-- @param args.conditions function | ||
function RoadTodo.new(args) | ||
local self = setmetatable({}, RoadTodo) | ||
self.key = args.key | ||
self.desc = args.desc | ||
self.conditions = args.conditions | ||
return self | ||
end | ||
|
||
function RoadTodo:checkCondition(objectTags, resultTags) | ||
if self.conditions(objectTags, resultTags) then | ||
return self.key | ||
else | ||
return nil | ||
end | ||
end | ||
|
||
-- === Fahrradstraßen === | ||
local check_cycleway_shared = RoadTodo.new({ | ||
key = "check_cycleway_shared", | ||
desc = "Tagging `cycleway=shared` is very old tagging and should be checked an maybe removed.", | ||
conditions = function(tagsObject, _) | ||
return tagsObject.cycleway == "shared" | ||
end | ||
}) | ||
|
||
|
||
-- Public funtion | ||
function RoadTodos(tagsObject, resultTags) | ||
local todos = {} | ||
|
||
todos[#todos + 1] = check_cycleway_shared:checkCondition(tagsObject, resultTags) | ||
|
||
return RemoveNilValues(todos) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters