diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/geos/geometry.py | 12 | ||||
| -rw-r--r-- | django/contrib/gis/geos/prototypes/topology.py | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py index 1ebecc864b..80770dfa6b 100644 --- a/django/contrib/gis/geos/geometry.py +++ b/django/contrib/gis/geos/geometry.py @@ -499,6 +499,18 @@ class GEOSGeometryBase(GEOSBase): """ return self._topology(capi.geos_buffer(self.ptr, width, quadsegs)) + def buffer_with_style(self, width, quadsegs=8, end_cap_style=1, join_style=1, mitre_limit=5.0): + """ + Same as buffer() but allows customizing the style of the buffer. + + End cap style can be round (1), flat (2), or square (3). + Join style can be round (1), mitre (2), or bevel (3). + Mitre ratio limit only affects mitered join style. + """ + return self._topology( + capi.geos_bufferwithstyle(self.ptr, width, quadsegs, end_cap_style, join_style, mitre_limit), + ) + @property def centroid(self): """ diff --git a/django/contrib/gis/geos/prototypes/topology.py b/django/contrib/gis/geos/prototypes/topology.py index f8c36bc6f5..9ca0dce695 100644 --- a/django/contrib/gis/geos/prototypes/topology.py +++ b/django/contrib/gis/geos/prototypes/topology.py @@ -21,6 +21,7 @@ class Topology(GEOSFuncFactory): # Topology Routines geos_boundary = Topology('GEOSBoundary') geos_buffer = Topology('GEOSBuffer', argtypes=[GEOM_PTR, c_double, c_int]) +geos_bufferwithstyle = Topology('GEOSBufferWithStyle', argtypes=[GEOM_PTR, c_double, c_int, c_int, c_int, c_double]) geos_centroid = Topology('GEOSGetCentroid') geos_convexhull = Topology('GEOSConvexHull') geos_difference = Topology('GEOSDifference', argtypes=[GEOM_PTR, GEOM_PTR]) |
