5

I'm having a bit of trouble with ST_Buffer and join styles. Basically, if I try and use the bevel style it outputs as if I was using the round style.

I notice that the ST_Buffer docs state that GEOS 3.2 or above is needed for bevel to work. I'm using GEOS 3.3.7, but I've also tried downgrading to various GEOS versions (3.3.5, 3.3.0, etc) to no avail.

The only way I've managed to get bevel to work is by using Postgres.app as my PostGIS database instead of my manual homebrew installation. I can't work out why my homebrew version doesn't do it even when they're both using the same GEOS (3.3.5).

Is there something that I'm missing? Perhaps I need to update / do something with my existing PostGIS database after downgrading / changing GEOS?

Update

Basically, what I'm trying to achieve is an expanded polygon (say by 3 metres) with sharp corners. ST_Buffer seems to be the logical choice here. However, I'm happy to explore other options that would a) let me remove the rounded corners after using ST_Buffer, or b) let me use something other than ST_Buffer to achieve the same effect.

1
  • How should the algorithm know which corners to make sharp for a polygon? My understanding of the buffer algorithm was that the styles referred to the end-caps of lines, with no special behaviour for closed rings. Mar 4, 2013 at 21:06

1 Answer 1

2
+25

Was your homebrewed PostGIS statically compiled against GEOS? Probably not, but if so, that PostGIS is stuck with a version of GEOS where the bevel doesn't work. To see what version of GEOS PostGIS is using run the following query:

SELECT postgis_full_version();

If it is running against an older version you'll need to recompile PostGIS, and reinstall the extensions. If you're using PostgreSQL 9.1 or greater you can use ALTER EXTENSION to upgrade PostGIS in place.

FYI, on my Ubuntu box the bevel option works just fine with GEOS 3.3.5.

1
  • Thanks for the help. Here is the output of the version query… "POSTGIS="2.0.2 r10789" GEOS="3.3.7-CAPI-1.7.7" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.7.8" LIBJSON="UNKNOWN"" I've been checking that every time I upgrade GEOS and it always reflects the latest version installed (without using ALTER EXTENSION). Mar 2, 2013 at 11:46

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.