Quantcast
Channel: Get all polygons that intersect with a circle around a given point - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Dan for Get all polygons that intersect with a circle around a given point

$
0
0

This is old, but it is still one of the topmost Google hits when searching for this issue. The existing answer is not useful as it cannot reasonably be implemented for use in MySQL - at least not in any manner that has remotely acceptable performance.

The solution is to use ST_Buffer with your point / radius:

ST_Buffer(point, radius)

An example query, for a table containing a column "polygon" which contains polygon data, to return rows that a circle with center at point mypoint with radius of 9 intersects:

SELECT * FROM mytable WHERE ST_Intersects(polygon, ST_Buffer(mypoint, 9))

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>