tilematrix
tilematrix copied to clipboard
bad intersection check on `tiles_from_geom()`
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.