1

I have a series of polygons stored in a MySQL table that I need to return as exploded polygons which are a minimum of a given distance from the original.

The ST_Buffer function performs a very similar function to what I am after however the distance between this polygon and the original must be at least the distance value specified.

The manual states:

ST_Buffer Returns a geometry that represents all points whose distance from the geometry value g is less than or equal to a distance of d

The problem I am facing is the ST_Buffer function is returning polygons which are only being exploded by 2.6nm in places instead of the minimum distance of 3nm I have set

SELECT ST_AsGeoJSON(ST_Buffer(ST_ExteriorRing(boundary),0.05')) AS `extended_boundary` from boundaries'

Is there a similar function that guarantees a minimum distance? It doesn't matter if it goes over by a small amount but it must be no less than the distance specified.

EDIT/Solution: I ended up creating a Postgres database to solve this with the PostGIS library and the geography data type. It feels like an overkill to run it just for a single table and query but the MySQL library lacks the required functionality.

Nibbles
  • 11
  • 2
  • Did you tried diferrent buffer strategies in the ST_Buffer function? Such as point_square, end_flat or join_round? – Ohlsen1980 Sep 14 '17 at 06:25
  • I did. In the end I swapped the entire thing to use Postgres instead as it was more a function of trying to do spherical calculations with a geometry library rather than a geography one. – Nibbles Sep 18 '17 at 04:14

0 Answers0