[GRASS-dev] [GRASS GIS] #2539: v.in.ogr: error importing shapefiles: ValueError : too many values to unpack

GRASS GIS trac at osgeo.org
Mon Jan 12 08:18:15 PST 2015


#2539: v.in.ogr: error importing shapefiles: ValueError  :  too many values to
unpack
----------------------------------------+-----------------------------------
 Reporter:  richardc                    |       Owner:  grass-dev@…              
     Type:  defect                      |      Status:  new                      
 Priority:  blocker                     |   Milestone:  7.0.0                    
Component:  wxGUI                       |     Version:  svn-releasebranch70      
 Keywords:  wxgui vector import wizard  |    Platform:  Linux                    
      Cpu:  x86-32                      |  
----------------------------------------+-----------------------------------

Comment(by mlennert):

 Replying to [comment:3 martinl]:
 > I cannot reproduce this bug. Please can you check it again with the
 fresh installation?

 I have trouble finding a clear logic in all this as sometimes it seems to
 work and sometimes not. But I think I found a candidate of what might
 explain it
 [http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.external/list.c#L326
 1], but only with gdal < 1.11 :


 {{{
 312     #if GDAL_VERSION_NUM >= 1110000
 313                     for (igeom = 0; igeom <
 OGR_FD_GetGeomFieldCount(Ogr_featuredefn); igeom++) {
 314                         Ogr_geomdefn =
 OGR_FD_GetGeomFieldDefn(Ogr_featuredefn, igeom);
 315                         if (!Ogr_geomdefn) {
 316                             G_warning(_("Invalid geometry column %d"),
 igeom);
 317                             continue;
 318                         }
 319
 320                         Ogr_geom_type =
 OGR_GFld_GetType(Ogr_geomdefn);
 321                         fprintf(fd, "%s,%s,%d,%s\n", layer_name,
 322
 feature_type(OGRGeometryTypeToName(Ogr_geom_type)),
 323                                 proj_same,
 OGR_GFld_GetNameRef(Ogr_geomdefn));
 324                     }
 325     #else
 326                         fprintf(fd, "%s,%s,%d,\n", layer_name,
 327
 feature_type(OGRGeometryTypeToName(Ogr_geom_type)),
 328                                 proj_same);
 329     #endif
 }}}


 Line 326 reads:

 {{{
 fprintf(fd, "%s,%s,%d,\n"
 }}}

 should the last comma really be there ? Erasing it away seems to solve the
 problem for me.

 However, this would not explain the problem for RichardC as he seems to be
 working with gdal 1.11...

 Moritz

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2539#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list