I'm looking to ensure that all geometries saved to the database are three-dimensional. It's easy enough to do with a call to the database,
select ST_Force_3D( ST_GeomFromText( blah blah ) )
...but that means for every object saved in the database, we make two database calls. Yuck!
Is there a simple way of invoking PostGIS functions without making a call to the database? We're using PostGIS 1.5 on top of Postgres 9.1 with GeoDjango on top of Python 2.7.
I've been working with GEOSGeometry objects, and they will tell you if your geometry is three-dimensional with the .hasz function, but I'm looking to FORCE everything to be three-dimensional without having to manually add a third dimension for every coordinate pair on every geometry we create.
Thanks!
set_z(0)
on the GEOSGeometry object, it will throw an error:GEOSException: Cannot set Z on 2D Point.