Skip to content

Commit

Permalink
Refs #23919 -- Updated obsolete buffer() references to memoryview().
Browse files Browse the repository at this point in the history
Obsolete since 8cdc847.
  • Loading branch information
felixxm authored Oct 13, 2022
1 parent da2621c commit 7c884af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions django/contrib/gis/geos/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ def json(self):
def wkb(self):
"""
Return the WKB (Well-Known Binary) representation of this Geometry
as a Python buffer. SRID and Z values are not included, use the
as a Python memoryview. SRID and Z values are not included, use the
`ewkb` property instead.
"""
return wkb_w(3 if self.hasz else 2).write(self)

@property
def ewkb(self):
"""
Return the EWKB representation of this Geometry as a Python buffer.
Return the EWKB representation of this Geometry as a Python memoryview.
This is an extension of the WKB specification that includes any SRID
value that are a part of this geometry.
"""
Expand Down Expand Up @@ -535,7 +535,7 @@ 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.
Same as buffer() but allows customizing the style of the memoryview.
End cap style can be round (1), flat (2), or square (3).
Join style can be round (1), mitre (2), or bevel (3).
Expand Down Expand Up @@ -721,7 +721,7 @@ def __init__(self, geo_input, srid=None):
- WKT
- HEXEWKB (a PostGIS-specific canonical form)
- GeoJSON (requires GDAL)
* buffer:
* memoryview:
- WKB
The `srid` keyword specifies the Source Reference Identifier (SRID)
Expand Down Expand Up @@ -751,7 +751,7 @@ def __init__(self, geo_input, srid=None):
# When the input is a pointer to a geometry (GEOM_PTR).
g = geo_input
elif isinstance(geo_input, memoryview):
# When the input is a buffer (WKB).
# When the input is a memoryview (WKB).
g = wkb_r().read(geo_input)
elif isinstance(geo_input, GEOSGeometry):
g = capi.geom_clone(geo_input.ptr)
Expand Down
10 changes: 5 additions & 5 deletions docs/ref/contrib/gis/geos.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Geometry Objects

.. class:: GEOSGeometry(geo_input, srid=None)

:param geo_input: Geometry input value (string or buffer)
:param geo_input: Geometry input value (string or :class:`memoryview`)
:param srid: spatial reference identifier
:type srid: int

Expand All @@ -206,14 +206,14 @@ The ``srid`` parameter, if given, is set as the SRID of the created geometry if
The following input formats, along with their corresponding Python types,
are accepted:

======================= ==========
======================= ==============
Format Input Type
======================= ==========
======================= ==============
WKT / EWKT ``str``
HEX / HEXEWKB ``str``
WKB / EWKB ``buffer``
WKB / EWKB ``memoryview``
:rfc:`GeoJSON <7946>` ``str``
======================= ==========
======================= ==============

For the GeoJSON format, the SRID is set based on the ``crs`` member. If ``crs``
isn't provided, the SRID defaults to 4326.
Expand Down

0 comments on commit 7c884af

Please sign in to comment.