Ticket #11433: 3d_hack.diff

File 3d_hack.diff, 820 bytes (added by jbronn, 6 years ago)

Hack that sends 3D geometry to the database.

  • django/contrib/gis/db/backend/postgis/adaptor.py

     
    66from psycopg2 import Binary
    77from psycopg2.extensions import ISQLQuote
    88
     9from django.contrib.gis.geos import WKBWriter
     10
     11wkb_3d = WKBWriter()
     12wkb_3d.outdim = 3
     13
    914class PostGISAdaptor(object):
    1015    def __init__(self, geom):
    1116        "Initializes on the geometry."
    1217        # Getting the WKB (in string form, to allow easy pickling of
    1318        # the adaptor) and the SRID from the geometry.
    14         self.wkb = str(geom.wkb)
     19        self.wkb = str(wkb_3d.write(geom))
    1520        self.srid = geom.srid
    1621
    1722    def __conform__(self, proto):
Back to Top