If you're using PostGIS, one option might be to call its dumper as a
separate process.
http://postgis.refractions.net/docs/ch04.html#id2638528

Don't know what tools exist for other spatial databases...


On Oct 12, 1:50 am, Evan Bowling <evan.bowl...@gmail.com> wrote:
> Hello all!
>
>     I was wondering if anyone knew if there was a way to output a
> shapefile from a django database. I didn't find anything in previous
> posts, and couldn't figure anything out just yet looking at django/
> contrib/gis/gdal/datasource.py
>
> I was hoping I could do something like the following:
>
> >>> import os
> >>> from geodjango import world
> >>> world_shp = os.path.abspath(os.path.join(os.path.dirname(world.__file__),
>
> ...                             'data/TM_WORLD_BORDERS-0.3.shp'))
>
> >>> from django.contrib.gis.gdal import *
> >>> ds = DataSource(world_shp)
> >>> ds.save('data/TM_WORLD_BORDERS-0.3_new.shp')
>
> I'm working on creating an application where users can create their
> own dataset using OpenLayers or Google Maps, and I would like to
> create an option to export the data in a shapefile format.
>
> Thanks,
> Evan
>
> I am Django (and so can you!)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to