Skip to content

Create helpers for isSomething while supporting multi-valued tags #110

@mojodna

Description

@mojodna

Right now, boilerplate looks like:

  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions