title: Postgis - How to find whether two circles based on two points overlap?
body: <p>I can calculate the distance between two points using:</p>
  
  <pre><code>SELECT ST_Distance(
    ST_GeomFromText('SRID=4326;POINT(54.5972850 -5.930119)')
  , ST_GeomFromText('SRID=4326;POINT(54.516827 -5.958130)'),
  false);
  </code></pre>
  
  <p>However, my goal is to create a rough circular zone (this can be square, hexagon, octagon .etc) around each point and then check if the zones overlap.</p>
  
  <p>I am looking at <a href="https://postgis.net/docs/ST_Overlaps.html" rel="nofollow noreferrer">ST_Overlaps</a> as a possible solution but I am not sure how to convert these points into polygons to be compared. My ideal result would be something like:</p>
  
  <pre><code>SELECT ST_Overlaps(
    ST_CreateCircularPolygon(geom1, 1000, 6)
    ST_CreateCircularPolygon(geom2, 10000, 4)
  );
  </code></pre>
  
  <p>Where:</p>
  
  <pre><code>ST_CreateCircularPolygon(geomerty, metreRadius, numberOfRadialPoints (e.g. 6 creates a hexagonal polygon))
  </code></pre>
  
  <p>Any guidance would be much appreciated!</p>