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.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
This tracker is not meant as a support channel, please write to the
GeoDjango mailing list for support.
https://groups.google.com/forum/#!forum/geodjango
--
Ticket URL: <https://code.djangoproject.com/ticket/22041#comment:1>