1

I'm trying to buffer points and scale the buffer around the points themselves. According to the documentation this can be done by supplying the factor as a point to the second argument and the origin to the third.

But my scaled buffers are not coming out correctly and have no extent according to QGIS. How can I scale the buffers around the points' origins?

Here's an example of what I have currently:

DROP TABLE IF EXISTS zones;
CREATE TABLE zones AS (
WITH
coords AS (
SELECT *
FROM ( VALUES
    (1, 101, 201),
    (2, 104, 204),
    (3, 109, 209)
   ) p(id, x, y)
),
points AS (
    SELECT id, st_setsrid(st_point(x, y), 32616) geom
      FROM coords
)
SELECT id, ST_Scale(st_buffer(geom, 1), ST_Point(4, 8), geom) geom
  FROM points
)
3
  • 1
    Have you tried just specifying the size of the buffer in the second argument of ST_Buffer?
    – Mike T
    Commented Apr 2, 2019 at 4:22
  • How are your points not coming out correctly? The scaled points have an area of 99.86, and most definitely have an extent. If you put an ST_Area or ST_AsText around ST_Scale you will see this. Commented Apr 2, 2019 at 8:07
  • Are you trying to scale in place, if so, you probably want the centroid of the geometry as the last parameter. Commented Apr 2, 2019 at 8:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.