Mark Williams
Mark Williams

Reputation: 1310

Finding row with coordinates inside a defined polygon in MySQL

I'm trying to figure out how to go about returning a set of records which have coordinates within a polygon.

I have looked at the MySQL spacial extensions but they don't currently support searching within a specified polygon, only within the minimal bounding rectangle of the polygon.

I was wondering if anyone has come across this problem before and knew of any solutions?

Thanks

Upvotes: 1

Views: 793

Answers (2)

Vassilis
Vassilis

Reputation: 2928

with this I have solve my similar issue... hope it helps.

Upvotes: 0

SVD
SVD

Reputation: 4753

There probably isn't (and won't be) built-in support for that, because determining if a point is within a generic polygon is a rather complex problem.

Perhaps you should get the "candidate" points that fit into the bounding rectangle, then find the ones in the actual polygon by running them through one of those PIP algorithms.

Upvotes: 1

Related Questions