def isForest(tags: Column): Column =
array_contains(splitDelimitedValues(tags.getItem("landuse")), "forest") as 'isForest
Let's see if we can fold up the array_contains and splitDelimitedValues to avoid mistakes when creating new functions.
This may make it easier to implement complex checks like:
def isLake(tags: Column): Column =
(array_contains(splitDelimitedValues(tags.getItem("natural")), "water") and
(tags("water").isNull or
not(array_contains(splitDelimitedValues(tags.getItem("water")), "river") or
array_contains(splitDelimitedValues(tags.getItem("water")), "canal")
)
)
) as 'isLake
Right now, boilerplate looks like:
Let's see if we can fold up the
array_contains
andsplitDelimitedValues
to avoid mistakes when creating new functions.This may make it easier to implement complex checks like: