Bug report #11800

documentation error in qgis:creategrid and associated errors it Hex grid from layer script

Added by ramon . over 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:2.6.1 Regression?:No
Operating System:all Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:20024

Description

Running the "Hex grid from layer" script gives this error:
----
Oooops! The following output layers could not be open
grid: /tmp/processing/1429ad65364842438cdb2532e93107f5/grid.shp
The above files could not be opened, which probably indicates that
they were not correctly produced by the executed algorithm
Checking the log information might help you see why those layers were
not created as expected
----

The log helpfully suggests:
----
Horizontal spacing is too small for the covered area
----

Running the "Create Grid" gui with the same values gives this in the log:
----
#ALGORITHM|Sat Dec 06 2014 18:31:27|processing.runalg("qgis:creategrid",3,7829,10226,200,200,353075,6595874,"EPSG:28351","/home/user/temp.shp")
----
which is to say
processing.runalg("qgis:creategrid", gridtype, width, height, hspacing, vspacing, centerx, centery, CRStype, savename)

This is different to the documentation
processing.runalg('qgis:creategrid', hspacing, vspacing, width, height, centerx, centery, gridtype, savename)

which the "Hex grid from layer" script follows
processing.runalg('qgis:creategrid', cellsize, cellsize, width, height, centerx, centery, 3, input.crs().authid(), grid)

I'll assume qgis:creategrid alg is correct and the documentation needs an update (if you can point me in the right direction I can do that), and am providing a patch for the "Hex grid from layers" script

Hex_grid_from_layer_bounds.diff Magnifier - diff patch (609 Bytes) ramon ., 2014-12-06 03:47 AM

Hex_grid_from_layer_bounds2.py Magnifier - Working script (544 Bytes) ramon ., 2014-12-06 03:47 AM

History

#1 Updated by ramon . over 9 years ago

I notice I've not been clear about which docs I'm talking about.

The documentation in the user guide is correct.
It's the in application that needs an update.

The patch for the script adjusts the script to fit the user manual docs and the information from the algorithm in the log.

#2 Updated by ramon . over 9 years ago

I see in this thread http://lists.osgeo.org/pipermail/qgis-community-team/2014-December/004001.html that the documentation in >2.7 will be pointing to the user manual descriptions, and therefore should be correct (or at least more than it is now.

Clearly, I've not been paying enough attention, and am making un-needed noise about the docs bit.

#3 Updated by Giovanni Manghi over 9 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

will be fixed when this PR will be committed

https://github.com/qgis/QGIS-Processing/pull/6

but closing because anyway this script is not part of qgis source code, but belongs to the QGIS-processing scripts repository.

#4 Updated by ramon . over 9 years ago

Thanks.

I presumed, that since it was part of processing it lived in here somewhere...

At least I know where to put something like this next time.

#5 Updated by Giovanni Manghi almost 9 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF