UnownHash / Fletchling

10 stars 3 forks source link

Another attempt at overlap query fix #45

Closed comstud closed 7 months ago

comstud commented 7 months ago

It appears this is a problem on mysql because ST_Area() bombs on non-2D objects while MariaDB just returns 0.

What we actually care about is ST_Contains() and not ST_Intersects(). ST_Intersects() will return true if only an edge intersects, but ST_Contains() will ensure there's at least some amount of containment/area.

I've kept ST_Intersects() in front of ST_Contains() because the query was super slow without it. Keeping it reduces calls to ST_Contains().