24 - Find the area derived from a feature

The previous example illustrated how to turn an area into a way, so that we can plot it on the map. For that we used the pivot filter.

Sometimes it can be helpful to go the other way and find the area that corresponds to a way or relation. To do that we use the map_to_area statement.

This allows us to then do spatial queries using that area, which we can't do with the original way or relation.

For example in this query we find the OSM relation tagged as Mutitjulu.

This is intended to represent an administrative boundary for the Mutitjulu community that is found just east of Uluṟu. This is stored in a temporary named set.

We then use the map_to_area statement to find the area corresponding to that relation. This is saved in a variable called mutitjulu.

We then do a couple of type agnostic queries to find node, ways and relations that are tagged as buildings or leisure areas.

Links
Source File24-mapToArea.osm
Authors
  • Leigh Dodds