dhilton

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Error when importing into GeoDjango #3939

    dhilton
    Participant

    It’s not so much a geodjango issue as it is a PostGIS / property issue. The django app uses a specfic mapping of shapefile properties to internal database columns; change the fields and the db schema and it will load the data fine. The problem comes when you try and use the data in a meaningful way. I’ve used ogrinfo and qGis to inspect the properties of the shapefile but can’t seem to find much to help me. At the moment the app loads all of the counties but they’re not within their countries nor have their administrative names attached to them. Any ideas or pointers about where I can learn more about this so I can help?

    in reply to: Error when importing into GeoDjango #3937

    dhilton
    Participant

    I tried using the amended data but to no avail.

    I got the following error on django 1.1.1:

    ./manage.py ne_import_countries ./data/10m_admin_1_version1b1.shp
    Datasource has 1 layers
    Importing Layer 10m_admin_1_version1b1 of type Polygon, size: 3786
    Traceback (most recent call last):
    File "./manage.py", line 16, in <module>
    execute_manager(settings)
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/management/base.py", line 322, in handle
    label_output = self.handle_label(label, **options)
    File "./django-natural-earth/natural_earth/management/commands/ne_import_countries.py", line 35, in handle_label
    transform=False, encoding='iso-8859-1')
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/gis/utils/layermapping.py", line 187, in __init__
    self.check_layer()
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/gis/utils/layermapping.py", line 319, in check_layer
    idx = check_ogr_fld(ogr_name)
    File "/var/www/python/mapy/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/gis/utils/layermapping.py", line 265, in check_ogr_fld
    raise LayerMapError('Given mapping OGR field "%s" not found in OGR Layer.' % ogr_map_fld)
    django.contrib.gis.utils.layermapping.LayerMapError: Given mapping OGR field "SHAPE_AREA" not found in OGR Layer.

Viewing 2 posts - 1 through 2 (of 2 total)