1. There a GeoDjango sublist, better place to ask.
2. Strip out the Z when doing the database import, you don't say which
db backend your're using.
2a. If you can't do it on import than do it with an update query.

http://gis.stackexchange.com/questions/78142/how-can-i-strip-out-z-values-in-postgis

Thanks,
Alex

On 03/07/2016 10:36 AM, Jônatas Castro wrote:
> In my project I need to import *shapefiles* and same some geometry.
> 
> Some of these are *MULTIPOLYGON Z* type, but all Z coordinates are 0-value.
> 
> When I try to save the geometry, I get the error: *"Geometry has Z 
> dimension but column does not".*
> 
> *What is the best way to strip the Z dimension?*
> 
> 
> 
> My code:
> 
> 
> 
> *ds = DataSource(file_path, encoding='ISO-8859-1')layers = ds[0]*
> 
> *#need something HERE to coerce geometry to 2D*
> 
> 
> *obj=MyModel(geometry=GEOSGeometry(layers[0].geom.hex))*
> *obj.save()*
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56DDCDCF.5090908%40wildintellect.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to