1

I have the following code to get 30m geometry shapes from a point layer already created

CREATE TABLE intrsct_buff AS ( SELECT ST_Transform( ST_Buffer( ST_Transform(pt.geom,4326)::geography, 30.0), 2263) as geom, pt.count FROM public.intrsct_pts as pt );

I keep receiving the error: LINE 3 function st_transform(geography, integer) does not exist What do I need to add in front of ___,SRID 2263? That seems to be the ST_Transform function where they say I have an error

sTonystork
  • 137
  • 8

1 Answers1

4

You need to transform the geography back into geometry; ST_Transform does not work with geography:

CREATE TABLE intrsct_buff AS ( 
  SELECT
    ST_Transform(
      ST_Buffer(
        ST_Transform(
          pt.geom,
          4326
        )::geography,
        30.0
      )::geometry,
      2263
    ) as geom,
    pt.count
  FROM
    public.intrsct_pts as pt
);
Avocado
  • 871
  • 6
  • 23
  • That was all i needed! Thank you avocado I had been stuck on this for a while, will eat one of you tomorrow in appreciation!! – sTonystork Apr 24 '20 at 00:43
  • Awesome! Feast away! You can always check out the argument types for postgis functions in their docs, e.g., https://postgis.net/docs/ST_Transform.html – Avocado Apr 24 '20 at 01:46