#22041: LayerMapError: Django cannot import shapefile into postgresql -------------------------------+-------------------- Reporter: klopycira | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 1.6 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------- I am working on a web-based gis project using geodjango under django 1.6 framework. . I have using postgresql 9.1 and python 2.7 while following the tutorial on installing and making first apps in django, i have worked on the sample (world, as presented in tutorial) and it worked properly. As soon as i have created my own apps using srid=32651, I have this error:
LayerMapError: Could not retrieve geometry from feature below are my codes, and i don't know i got my mistake. . thanks in advance for helping out. . cheers! models.py {{{ from django.db import models from django.contrib.gis.db import models as gismodels class Butuan_Parcel(gismodels.Model): newpin = models.CharField(max_length=35) geometry = gismodels.MultiPolygonField(srid=32651) objects = gismodels.GeoManager() def __unicode__(self): return self.newpin # Create your models here. }}} settings.py {{{ import os from django.contrib.gis.utils import LayerMapping from models import Butuan_Parcel bound_mapping = { 'newpin': 'NEWPIN', 'geometry': 'MULTIPOLYGON', } bound_shp = os.path.abspath(os.path.join(os.path.dirname(__file__),'data/parcels.shp')) def run(verbose=True): lm = LayerMapping(Butuan_Parcel, bound_shp, bound_mapping, transform=False, encoding='iso-8859-1') lm.save(strict=True, verbose=verbose) }}} load.py {{{ import os from django.contrib.gis.utils import LayerMapping from models import Butuan_Parcel bound_mapping = { 'newpin': 'NEWPIN', 'geometry': 'MULTIPOLYGON', } bound_shp = os.path.abspath(os.path.join(os.path.dirname(__file__),'data/parcels.shp')) def run(verbose=True): lm = LayerMapping(Butuan_Parcel, bound_shp, bound_mapping, transform=False, encoding='iso-8859-1') lm.save(strict=True, verbose=verbose) }}} -- Ticket URL: <https://code.djangoproject.com/ticket/22041> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.24aff1e73d725ee6c31f9f1473d208b5%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.