Hi,
I'm initiating in webGIS in general and decide to choose GeoDjango. So this is a newbie question.
I'm trying to create a system to receive a ShapeFile and import to DB.
First I try use LayerMapping, then I realize that I couldn't pass values of my system that not exists in the shapefile.
So I decide to use DataSources to get just the poilygon coordenates and save my data.
But in very different ways, allways a received an type of data error.
One example bellow:
cannot set Orcamento GeometryProxy with value of type: <class 'django.contrib.gis.geos.polygon.Polygon'>
The important data of my model:
mpoly = models.MultiPolygonField()
objects = models.GeoManager()
The code to save:
ds = DataSource(file_full)
for layer in ds:
print layer.geom_type
for polyg in layer.get_geoms(geos=True):
#poly = GEOSGeometry(polyg, srid=4329)
orc = Orcamento(session_id = session_id, mpoly = polyg)
orc.save()
the OGRINFO for the SHAPEFILE that I create to test
ogrinfo -so teste.shp teste
INFO: Open of `teste.shp'
using driver `ESRI Shapefile' successful.
Layer name: teste
Geometry: 3D Polygon
Feature Count: 1
Extent: (-43.827768, -20.346558) - (-43.817162, -20.336426)
Layer SRS WKT:
GEOGCS["GCS_WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]
Name: String (80.0)
Descriptio: String (80.0)
Can I get a conclusion that I can't create a system to put any kind of shape file (with a Polygon layer) to my system withouth a standard?
Thanks in advance,
Fernando G. Norte
BHte - MG - Brazil
cel: +55 31 9119 8814
-------------------------
MSN e Gtalk #
fno...@gmail.com