<div dir="ltr">Hi,<div><br></div><div>I like the idea of changing 1/-1 to left/right, it's more humane.</div><div>How about side=left/right/both for less presses of shift key? :)</div><div><br></div><div>As a person who mixes left and right I would also like have a setting that doesn't mention "left" and "right" at all.<br>It's visually tricky sometimes, to convert the screen's "east" to "right" for a line that goes "southwards/down", and then write that into query from first attempt.</div><div><br>I'll quote again a property I expect to hold true without mentioning "left" and "right":</div><div>>> I expect ST_Buffer(ST_Boundary(ST_ForceRHR(polygon)), 10, 'single_side') to be buffered "outside".</div><div><br></div><div>Or at least a highlight in docs that will tell me whether it's left or right each time I forget :)<br></div></div><br><div class="gmail_quote"><div dir="ltr">пт, 19 янв. 2018 г. в 3:30, Stephen Knox <<a href="mailto:stephenknox73@gmail.com">stephenknox73@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Darafei,<br><br></div>Thanks for that good feedback.<br><br></div>Actually I think thinking it through I wonder if it would be better to have the option as single_side=left or single_side=right as I think that is much more intuitive. All the tests I've done on geometries indicate that geos honours the distance parameter as expected (positive is left hand side of the line and negative right - see <a href="https://geos.osgeo.org/doxygen/classgeos_1_1operation_1_1buffer_1_1BufferParameters.html#adc2afac5dacc613a39a72542bdb8bf21" target="_blank">https://geos.osgeo.org/doxygen/classgeos_1_1operation_1_1buffer_1_1BufferParameters.html#adc2afac5dacc613a39a72542bdb8bf21</a>). The only issue is by default it gives right hand buffers round joins and left hand buffers mitre joins, but this can be overridden.<br><br></div>Really this seems to be of greatest use for linestrings, as the buffer function already had a negative distance parameter for polygons, and whether single_side is true or not does not make any difference. With points again it ignores the parameter and undertakes a normal buffer, which is the only sensible thing to do.<br><br></div>I'll work on that basis and add in the code, tests and docs for the revised function and also submit a pull request from Github.<br><br></div>Thanks again<br><br></div></div><div dir="ltr">Stephen<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 18, 2018 at 10:23 AM, Darafei "Komяpa" Praliaskouski <span dir="ltr"><<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Thoughts that I have:</div><div><br></div><div> - this is a cool thing that I've needed multiple times. I worked around its absence by fiddling with ST_MakeLine(ST_Collect(line, ST_OffsetCurve(line, 1))) and then trying to make result valid, which sometimes worked;</div><div> - how do I remember which way is it being offset? I expect ST_Buffer(ST_Boundary(ST_ForceRHR(polygon)), 10, 'single_side') to be buffered "outside". Does it hold true?<br></div><div> - if there are no better ideas on ST_Buffer signature I'd say your option is good enough for me;</div><div> - there's no error reporting mentioning `single_side` as valid option;<br></div><div> - can `single_side=1` also work for `single_sided=1` and just `single_side`/`single_sided`?</div><div> - what does it do for line and for point?</div><div> - does it work on EMPTY, LINESTRING(0 0, 0 0), MULTILINESTRING, and self-intersecting one?</div><div> - how do I reverse the direction of buffering? I understand there's negative buffer parameter, does it work? I see you parse parameter to be single_side=1/0, maybe -1 will also make sense? </div><div> - out of curiosity, will ST_Buffer(geom,0,'single_side') fix invalid geometries? :)<br><br>As someone responsible for github in PostGIS, I encourage you to put it to GitHub as a PR: that'll get you test coverage report, travis CI greenlight, a way to comment on your patch inline, and usual PR merge time on it recently improved. :)</div><br><div class="gmail_quote"><div dir="ltr">чт, 18 янв. 2018 г. в 12:56, Stephen Knox <<a href="mailto:stephenknox73@gmail.com" target="_blank">stephenknox73@gmail.com</a>>:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-7089315067686529062h5"><div dir="ltr">Hi List,<div><br></div><div>I noticed that PostGIS didn't implement the single-sided buffer functionality of Geos (NB. not the Offset Curve functionality, but a polygon), so have submitted a patch to implement that: <a href="https://trac.osgeo.org/postgis/ticket/3989" target="_blank">https://trac.osgeo.org/postgis/ticket/3989</a> </div><div><br></div><div>I have refrained from adding tests and documentation until I get some agreement that the function signature is acceptable, as I am a new contributor, and I think the ST_Buffer signature is already quit "unusual" in that it implements text parameters.</div><div><br></div><div>I was hoping that post the recent patch releases, a more experienced contributor might be able to look at my (small) patch and give some feedback.</div><div><br></div><div>I can put it up on Github as well if that would help.</div><div><br></div><div>Many thanks</div><div><br>Stephen</div></div></div></div>
_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></blockquote></div></div>
<br>_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br></blockquote></div><br></div>
_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a></blockquote></div>