tilematrix icon indicating copy to clipboard operation
tilematrix copied to clipboard

bad intersection check on `tiles_from_geom()`

Open ungarj opened this issue 5 years ago • 0 comments

Tiles which intersect with a Polygon on its border get yielded although in fact they don't realy intersect (i.e. share a common area) with the geometry:

https://github.com/ungarj/tilematrix/blob/master/tilematrix/_tilepyramid.py#L229

use

if prepared_geometry.intersection(tile.bbox()).area

instead of

if prepared_geometry.intersects(tile.bbox()):

Note that we only are allowed to do this on "Polygon" and "MultiPolygon" geometries.

ungarj avatar Sep 14 '20 12:09 ungarj