osm2rdf
osm2rdf copied to clipboard
Correct handling of intersections
I see two issues with the intersection relations as they are currently implemented:
-
The
intersects_area
relation is exactly equivalent to thecontains_area
relation (see https://github.com/ad-freiburg/osm2rdf/blob/master/src/osm/GeometryHandler.cpp#L453), which effectively means thatintersects_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). -
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 aintersects_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 anintersects_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?