Opened 7 years ago
Closed 7 years ago
#28960 closed New feature (fixed)
Implement GEOS.BufferWithStyle
Reported by: | Stanislav Karpov | Owned by: | Stanislav Karpov |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | gis, geodjango, geos |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Hello.
I couldn't find a method that allows to specify a style for a new polygon. For example, flat end caps. Other examples with images are available at: http://www.postgis.net/docs/ST_Buffer.html
But I found a similar method in GEOS:
# https://github.com/OSGeo/geos/blob/master/capi/geos_c.h.in#L1442 extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle(const GEOSGeometry* g, double width, int quadsegs, int endCapStyle, int joinStyle, double mitreLimit);
Using flat end caps allows to significantly reduce the number of points in the polygon. For example, a segment of a straight line will only turn into a rectangle, not a polygon with rounded corners.
Change History (5)
comment:1 by , 7 years ago
Owner: | changed from | to
---|
comment:2 by , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 7 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
comment:4 by , 7 years ago
Portable version for Django < 2.1: https://gist.github.com/stkrp/468610f7be70be2d01adccb79ecccd6e.
PR (with comments for improvement)