osm2rdf icon indicating copy to clipboard operation
osm2rdf copied to clipboard

Correct handling of intersections

Open patrickbr opened this issue 2 years ago • 3 comments

I see two issues with the intersection relations as they are currently implemented:

  1. The intersects_area relation is exactly equivalent to the contains_area relation (see https://github.com/ad-freiburg/osm2rdf/blob/master/src/osm/GeometryHandler.cpp#L453), which effectively means that intersects_area is only correct between areas in which one contains the other. To indeed handle all named area intersections, it would be necessary to again iterate over all named areas and check for intersections, again using the DAG for speedup (if A intersects B, than A intersects all geometries containing B in the DAG), exactly like it is currently done for the ways (starting at https://github.com/ad-freiburg/osm2rdf/blob/master/src/osm/GeometryHandler.cpp#L873).

  2. Intersect relations are not symmetric. In particular, even the intersects_area relations that are currently implemented (see above) are not symmetric (this fix should be trivial, though). However, I am not so sure about the summetry of intersections between different types. For example, if a way intersects an area, then a intersects_nonarea relation is written between the area and the way, but the symmetric intersection should of course not be written, as the way intersects an area. It think, however, that an intersects_area relation should then be written (in line https://github.com/ad-freiburg/osm2rdf/blob/master/src/osm/GeometryHandler.cpp#L926) between the way and the area.

Any thoughts on this?

patrickbr avatar Dec 13 '21 14:12 patrickbr