7

I'm having difficulty with (I think) the ORM for geoalchemy2. My model is defined as follows:

class Location(Model):
    point = Column(Geometry('POINT', dimension=3, srid=4326))

I later insert as follows:

location = Location(point=WKTElement('POINT(65.567 32.95 1156.7)', 4326))
session.add(location)
session.commit()

This gives the following error:

Geometry has Z dimension but column does not.
astex
  • 1,045
  • 10
  • 28
  • I know this is a long time ago, but did you ever find a solution? – T. Furfaro Sep 22 '17 at 14:16
  • 1
    The 3D support is undocumented but it's there, see https://github.com/geoalchemy/geoalchemy2/issues/157 and https://github.com/geoalchemy/geoalchemy2/issues/67 – astrojuanlu Dec 13 '17 at 10:00
  • 1
    changing `POINT` into `POINTZ` seems to solve the issue; Although I experience that this wont work for `LINESTRINGZ` – Joost Döbken Jan 29 '19 at 09:28

0 Answers0