Bug report #13115

Processing qgis:vectorgrid to lines not working

Added by Nicklas Larsson over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:2.8.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21180

Description

Running the following in the console:
processing.runalg("qgis:vectorgrid","701457,701849,252365,252962",1,1,1,'/Users/me/gridline.shp')
raises the following OGR log message:

Feature creation error (OGR error: Attempt to write non-polygon (LINESTRING) geometry to POLYGON type shapefile.)

… and an empty (no geometries) shp file is created.

The gui version Vector>Research Tools>Vector Grid… gives the expected and correct result.

The source code for the two are independent of each other, but the latter's (/python/plugins/fTools/tools/doVectorGrid.py) implementation indicate the problem with the code of the former:

My suggestion (though untested):
/python/plugins/processing/algs/qgis/VectorGrid.py:93

   fields, QGis.WKBPolygon, mapCRS)

should change to:
    fields, QGis.WKBLineString, mapCRS)

Associated revisions

Revision 1714e669
Added by Giovanni Manghi over 9 years ago

fix Processing QGIS vector grid as lines

fixes #13115
(cherry-picked from 1dfec33)

History

#1 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Open to Feedback

Should be fixed with

https://github.com/qgis/QGIS/pull/2231

thanks!

#2 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF