﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12036	GIS layermapping utility fails to import linestrings	elpaso66	nobody	"
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))

}}}
"		closed	GIS	1.1		fixed	gis import		Unreviewed	0	0	0	0	0	0
