Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3989 closed patch (fixed)

Add single-sided buffer functionality from geos

Reported by: stev00 Owned by: dbaston
Priority: medium Milestone: PostGIS 2.5.0
Component: postgis Version: master
Keywords: Cc:

Description

I noticed that the ST_Buffer function does not implement the single-sided option available in geos (since CAPIv1 I think looking at git blame).

I have added a patch to address this. It is not yet comprehensive as, being a new contributor, I would like some feedback on what the function signature should be etc.

At the moment, it is implemented as a text string in buffer_style_parameters as this seemed like an appropriate option, but very happy to be corrected on this. It is a slightly messy implementation, as the parameter to the geos function is an integer, so I have kept it as that, although it could easily be a text 't' or 'f' or 'true' or 'false'. I also noted that the other parameters didn't raise any exceptions if input wasn't as expected, so have retained this behaviour.

I have done some limited testing, and run regression tests with no failures. I have not yet written additional tests and documentation, but will do that if and when the broad approach gets some sort of thumbs-up.

Attachments (1)

ss_buffer.patch (1.5 KB ) - added by stev00 7 years ago.
Code only patch

Download all attachments as: .zip

Change History (8)

by stev00, 7 years ago

Attachment: ss_buffer.patch added

Code only patch

comment:1 by stev00, 7 years ago

Version: 2.4.xtrunk

Just to add, the reason it has been implemented in the buffer_style_parameters parameter, is to avoid changing the signature of the function. People may feel it's more appropriate to have a separate function signature, but there are already 6, and I thought more would confuse further.

comment:2 by pramsey, 6 years ago

Milestone: PostGIS 2.4.3PostGIS 2.4.4

comment:3 by pramsey, 6 years ago

Owner: changed from pramsey to dbaston

Sorry this took so long to review.

comment:4 by pramsey, 6 years ago

Resolution: fixed
Status: newclosed

comment:5 by dbaston, 6 years ago

Committed to trunk at r16380, modified from https://github.com/postgis/postgis/pull/204

comment:6 by robe, 6 years ago

Milestone: PostGIS 2.4.4PostGIS 2.5.0

comment:7 by robe, 6 years ago

In 16431:

Add ST_Buffer side=arg enhancement not to the docs.
References #3989

Note: See TracTickets for help on using tickets.