mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[4.1.x] Updated example of creating GEOSGeometry from WKB to use memoryview.
Backport of da2621c3df from main
			
			
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							f72ba56af0
						
					
				
				
					commit
					202f5ae96a
				
			| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user