Pergunta

I'm new to MYSQL spatial functions. I have successfully created a database with 2 tables:

CREATE TABLE polys (poly POLYGON);
CREATE TABLE points (point POINT);

and have filled them with some test data (some points overlapping polygons, some not, some polys contain no points).

What would be the most efficient query to return both the polygons that are overlapped by any point, and a list of the points that are overlapping for each polygon? Is this possible in one query?

Many thanks

Foi útil?

Solução

Take a look at MBROverlaps.

MRBOverlaps(geometry1,geometry2) results in 1/0 if they overlap or not.

Have a look at the docs.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top