OpenStreetMap

Topology rules

Posted by Tomas Straupis on 14 April 2021 in English.

Topology

Problem

Once in a while discussion arises in OpenStreetMap: which polygon to render above which. For example we have a large forest and then a lake inside it. What to do? Render water above the forest! Cool! But wait, we have a small island covered with trees in that lake, so rendering water on top of the forest hides that island. What to do? Render forest above the water!… Oh wait…

And you can change water and forest to a lot of others: residential, industrial, meadow, wetland, you name it.

The point is that this cannot be solved by deciding “what has to be rendered above/below what” (well not fully). But if you decide which objects may or may not intersect, which objects must always be covered by which etc. - then you have better described ontology. Then you cut holes in forest/water example above to get not only a correct rendering, but also an often forgotten - correct analysis (for example calculation of water/forest area).

We also have some very small patches of wood/grass inside residential/industrial areas, we do not want to exclude those small patches from residential areas. Not only because it could make landuse geometry too complex, but because those small patches ARE still residential areas, altho covered with something. What do we do with those? We define SEPARATE classes to be used above other classes. Say we define landcover=trees to be used above (and only above) residential, commercial or industrial polygons. The same could go for patches of grass or small basins/ponds. With water we define, that small water objects like landuse=basin can be covered with the likes of landuse=residential, but natural=water (lakes), landuse=reservoir and waterway=riverbank - cannot intersect with landuse=residential.

Solution

It is nothing new. It is a very well known thing in GIS - topology rules. There are a lot of tooplogy rule types, I will not go through all of them, but interested reader could find it in say A* documentation

Example

When those rules are defined (even the small part of those, as it is done in Lithuania: Topology rules) it makes it very clear to everybody - mapers, creators of editors and QA tools, map makers - what goes above/below what.

As an additional bonus, it probably has a cartographic benefit, those small patches of trees/grass above other larger landuse can easily (without complex generalisation calculations) be removed on mid-small scales. Check how small patches of trees are removed on smaller scales removing clutter while larger forest patches are still visible: https://openmap.lt/#m/16.09/54.92935/23.95217/0/0/

With trees on larger scales: With trees

And here without trees on smaller scale: Without trees

Discussion

Log in to leave a comment