summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAlan D. Snow <alansnow21@gmail.com>2022-10-13 06:21:49 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-10-13 13:22:15 +0200
commit202f5ae96a9ac2e44fac9aee0dd5ed044d323abb (patch)
treec9958c725e0dd24b27a2daa4f7f73592cdb70249 /docs/ref
parentf72ba56af07d30a5b46df802536a11b330efbe10 (diff)
[4.1.x] Updated example of creating GEOSGeometry from WKB to use memoryview.
Backport of da2621c3dfef934000c479750e0276d992025542 from main
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/gis/geos.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt
index 08a64a2a1d..215f612b4a 100644
--- a/docs/ref/contrib/gis/geos.txt
+++ b/docs/ref/contrib/gis/geos.txt
@@ -55,7 +55,7 @@ are examples of creating the same geometry from WKT, HEX, WKB, and GeoJSON::
>>> from django.contrib.gis.geos import GEOSGeometry
>>> pnt = GEOSGeometry('POINT(5 23)') # WKT
>>> pnt = GEOSGeometry('010100000000000000000014400000000000003740') # HEX
- >>> pnt = GEOSGeometry(buffer('\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x007@'))
+ >>> pnt = GEOSGeometry(memoryview(b'\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x007@')) # WKB
>>> pnt = GEOSGeometry('{ "type": "Point", "coordinates": [ 5.000000, 23.000000 ] }') # GeoJSON
Another option is to use the constructor for the specific geometry type