Ticket #11433: 3dhack2.diff
File 3dhack2.diff, 897 bytes (added by , 15 years ago) |
---|
-
django/contrib/gis/db/backend/postgis/adaptor.py
6 6 from psycopg2 import Binary 7 7 from psycopg2.extensions import ISQLQuote 8 8 9 from django.contrib.gis.geos import WKBWriter 10 11 wkb_3d = WKBWriter() 12 wkb_3d.outdim = 3 13 9 14 class PostGISAdaptor(object): 10 15 def __init__(self, geom): 11 16 "Initializes on the geometry." 12 17 # Getting the WKB (in string form, to allow easy pickling of 13 18 # the adaptor) and the SRID from the geometry. 14 self.wkb = str(geom.wkb) 19 if geom.hasz: 20 self.wkb = str(wkb_3d.write(geom)) 21 else: 22 self.wkb = str(geom.wkb) 15 23 self.srid = geom.srid 16 24 17 25 def __conform__(self, proto):