Skip to content

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

Description

@sethfitz

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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