kart icon indicating copy to clipboard operation
kart copied to clipboard

Spatial filtering: improve intersection test

Open olsen232 opened this issue 2 years ago • 0 comments

Kart spatial filtering a.intersects(b) test is naive right now -

  • doesn't make sure long polygon edges are segmented into short lines before reprojecting, so the geographical location of the middle of the polygon's edge can change
  • doesn't consider the anti-meridians at all - might behave unexpectedly if the spatial filter or the layer crosses the antimeridian doesn't check if a spatial filter geometry can be wholly (or partially) reprojected into a target CRS, so this will simply fail if it cannot
  • Generally works fine in spite of this but these will all be needed at some point

(Note that the spatial-filter indexing code has managed to avoid these issues, for two reasons - firstly the indexer can afford to be conservative rather than exact, so these issues were much cheaper and easier to solve. Secondly, it's important to make sure that the indexer is creating a (hopefully) error-free index before indexing lots of repos - otherwise these will have to be reindexed later.)

olsen232 avatar Mar 02 '22 00:03 olsen232