#12036: GIS layermapping utility fails to import linestrings
------------------------+---------------------------------------------------
 Reporter:  elpaso66    |       Owner:  nobody    
   Status:  new         |   Milestone:            
Component:  GIS         |     Version:  1.1       
 Keywords:  gis import  |       Stage:  Unreviewed
Has_patch:  0           |  
------------------------+---------------------------------------------------
 It seems like there is an error in type comparison around line 288,
 objects gtype and ltype are tested for equality while probably their
 string values should be tested instead.

 File: trunk/django/contrib/gis/utils/layermapping.py

 The patch below should fix this issue and give a more complete error
 message.

 {{{
 @@ -288,9 +288,10 @@
                      raise LayerMapError('Invalid mapping for
 GeometryField "%s".' % field_name)

                  # Making sure that the OGR Layer's Geometry is
 compatible.
 +
                  ltype = self.layer.geom_type
 -                if not (gtype == ltype or self.make_multi(ltype,
 model_field)):
 -                    raise LayerMapError('Invalid mapping geometry; model
 has %s, feature has %s.' % (fld_name, gtype))
 +                if not (str(gtype) == str(ltype) or
 self.make_multi(ltype, model_field)):
 +                    raise LayerMapError('Invalid mapping geometry; model
 has %s, feature has %s instead of %s.' % (fld_name, gtype,  ltype))

 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12036>
Django <http://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 post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to