0

I would like to create 100 meters circle buffers in a UTM projection from a point table whose SRID is EPSG:4326 and keeping the id column. I wonder what is the straightest way. Is that possible to get it in one query after having created a buffer table with the URM SRID? Like:

INSERT INTO buffers SELECT id_points, ST_Buffer (geom, 100 , 'quad_segs=8') AS geom from points

but this would require I guess to add ST_transform somewhere and ST_Buffer does not like to involve two different SRID.

3
  • 3
    Just cast to geography within the buffer request. – Vince Feb 13 at 0:14
  • it seems it required to be cast twice: INSERT INTO buffers SELECT id_points, CAST(ST_Buffer(CAST(points.geom AS geography), 100 , 'quad_segs=8') AS geometry) AS geom from points. Thanks for the tip! – Severin Feb 15 at 17:40
  • or points.geom::geography,...)::geometry – Vince Feb 15 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.