Opened 15 years ago

Last modified 15 years ago

#10040 closed

GeoDjango: 'Save As' on spatial record (OSMGeoAdmin) creates broken copy *AND* corrupts the original record — at Version 2

Reported by: john@… Owned by: nobody
Component: GIS Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by jbronn)

Traceback for original record in Admin after SaveAs failed and created a dud copy:

Environment:

Request Method: GET
Request URL: http://url/admin/geo/borders/136/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.flatpages',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.gis',
 'vovo.geo']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in root
  157.                 return self.model_page(request, *url.split('/', 2))
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in model_page
  176.         return admin_obj(request, rest_of_url)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in __call__
  197.             return self.change_view(request, unquote(url))
File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in _commit_on_success
  238.                 res = func(*args, **kw)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in change_view
  590.             form = ModelForm(instance=obj)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in __init__
  216.             object_data = model_to_dict(instance, opts.fields, opts.exclude)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in model_to_dict
  138.             data[f.name] = f.value_from_object(instance)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py" in value_from_object
  332.         return getattr(obj, self.attname)
File "/usr/lib/python2.5/site-packages/django/contrib/gis/db/models/proxy.py" in __get__
  36.             geom = self._klass(geom_value)
File "/usr/lib/python2.5/site-packages/django/contrib/gis/geos/base.py" in __init__
  66.                 g = from_hex(geo_input, len(geo_input))
File "/usr/lib/python2.5/site-packages/django/contrib/gis/geos/prototypes/errcheck.py" in check_geom
  32.         raise GEOSException('Error encountered checking Geometry returned from GEOS C function "%s".' % func.__name__)

Exception Type: GEOSException at /admin/geo/borders/136/
Exception Value: Error encountered checking Geometry returned from GEOS C function "GEOSGeomFromHEX_buf".

The copy suffered much the same problem.

If I've not missed anything substantial (which is quite an If, honestly) I'd call something that causes data loss to be Critical.

Change History (2)

comment:1 by springmeyer, 15 years ago

John,

This is most likely an installation problem with proj4. Please make sure you have installed proj4 correctly (from source), including the datum files. For more information see http://geodjango.org/docs/install.html#proj-4

Also see ticket #9295 for work on provided a better error message.

Another solution is to not use the OSMGeoAdmin and rather switch to using the GeoAdmin.

comment:2 by jbronn, 15 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top