0

I am trying to run a buffer around a polyline (geography). My first attempt below (based on ST_Buffer documentation:

SELECT ST_Buffer(ST_Geomfromtext(i30.geog),10,'endcap=round join=round');

gives an error:

missing FROM-clause entry for table "i30"
ST_Geomfromtext(**^here**i30.geog)      
2
  • The error message is correct -- You did not include a required FROM clause. The examples you were working from don't include a FROM because a table isn't involved, but if you have a table, you need to reference it in the FROM: SELECT ST_Buffer(ST_Geomfromtext(i30.geog),10,'endcap=round join=round') FROM i30;
    – Vince
    Jul 14, 2015 at 17:49
  • Thanks, I added a from clause to the end of the statement. i30 is a table. SELECT ST_Buffer(ST_Geomfromtext(i30.geog),10, 'endcap=round join=round')FROM i30; Now getting a hint: No function matches the given name and argument types. You might need to add explicit type casts". Jul 14, 2015 at 18:03

1 Answer 1

3

What's i30? If it's a table, you'll need something like:

SELECT ST_Buffer(geog,10,'endcap=round join=round') FROM i30;

and your result will have a buffered geography for each row in i30.

3
  • Toby.. looking back at the information in the example I changed my attempt. to the following. SELECT ST_BUFFER(i30.geog, 10) FROM i30; It worked. THANKS. Jul 14, 2015 at 18:16
  • 1
    yeah no need for ST_GeomFromtext when you have a geom field already... Jul 14, 2015 at 18:18
  • 1
    Thanks, @mapBaker - I just pasted that from the question. Now edited. Jul 14, 2015 at 18:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.