Bug report #13115
Processing qgis:vectorgrid to lines not working
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
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
#2 Updated by Giovanni Manghi over 9 years ago
- Status changed from Feedback to Closed
Fixed in changeset 1714e66952956589256de3044c04994da98d7b75.