I had a similar issue when uploading a kml to geojson conversion to postgis 
using geodjango.  There is no efficient way to do it in Django, so I ended 
up doing a workaround


   - Create two geometry types, one with dims=2 and other with dims=3. 
    Allow both to be null and set default to null
   - When updating, check the geometry dimension via GEOSGeometry.hasz 
   
<https://docs.djangoproject.com/en/1.9/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry.hasz>.
 
    If the return is 2, save the geom in the 2D field, otherwise save to the 3D

You can create a save/retrieve method on the model to handle this for you.

-- 
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/93bf0664-7627-4a47-93df-6c8fb1238f35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to