6 changes: 6 additions & 0 deletions python/plugins/sextante/algs/mmqgisx/MMQGISXAlgorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from sextante.parameters.ParameterVector import ParameterVector
from sextante.outputs.OutputVector import OutputVector
from sextante.core.QGisLayers import QGisLayers
from sextante.parameters.ParameterCrs import ParameterCrs


class mmqgisx_delete_columns_algorithm(GeoAlgorithm):
Expand Down Expand Up @@ -381,6 +382,7 @@ class mmqgisx_grid_algorithm(GeoAlgorithm):
CENTERY = "CENTERY"
GRIDTYPE = "GRIDTYPE"
SAVENAME = "SAVENAME"
CRS = "CRS"

def defineCharacteristics(self):
self.name = "Create grid"
Expand All @@ -395,6 +397,7 @@ def defineCharacteristics(self):
self.gridtype_options = ["Rectangle (line)","Rectangle (polygon)","Diamond (polygon)","Hexagon (polygon)"]
self.addParameter(ParameterSelection(self.GRIDTYPE, "Grid type",
self.gridtype_options, default = 0))
self.addParameter(ParameterCrs(self.CRS, "CRS"))
self.addOutput(OutputVector(self.SAVENAME, "Output"))

#===========================================================================
Expand All @@ -413,6 +416,9 @@ def processAlgorithm(self, progress):
originy = centery - (height / 2.0)
gridtype = self.gridtype_options[self.getParameterValue(self.GRIDTYPE)]

crsId = self.getParameterValue(self.CRS)
self.crs = QgsCoordinateReferenceSystem(crsId)

if (hspacing <= 0) or (vspacing <= 0):
raise GeoAlgorithmExecutionException("Invalid grid spacing: " + unicode(hspacing) + " / " + unicode(vspacing))

Expand Down
11 changes: 4 additions & 7 deletions python/plugins/sextante/gui/help/algclasssification.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ qgis:countpointsinpolygon,USE_ORIGINAL_NAME,Vector/Statistics
qgis:countpointsinpolygonweighted,USE_ORIGINAL_NAME,Vector/Statistics
qgis:countuniquepointsinpolygon,USE_ORIGINAL_NAME,Vector/Statistics
qgis:createequivalentnumericalfield,USE_ORIGINAL_NAME,Vector/Table tools
qgis:creategrid,USE_ORIGINAL_NAME,Vector/Creation
qgis:creategrid,Create graticule,Vector/Creation
qgis:delaunaytriangulation,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:deletecolumn,USE_ORIGINAL_NAME,Vector/Table tools
qgis:deleteduplicategeometries,USE_ORIGINAL_NAME,Vector/General tools
qgis:densifygeometries,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:densifygeometriesgivenaninterval,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:difference,USE_ORIGINAL_NAME,Vector/Overlay
qgis:dissolve,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:distancematrix,USE_ORIGINAL_NAME,Vector/Points
qgis:distancetonearesthub,USE_ORIGINAL_NAME,Vector/Analysis
qgis:explodelines,USE_ORIGINAL_NAME,Vector/Lines
qgis:exportaddgeometrycolumns,USE_ORIGINAL_NAME,Vector/Table tools
Expand All @@ -117,7 +116,7 @@ qgis:fieldcalculator,USE_ORIGINAL_NAME,Vector/Table tools
qgis:fixeddistancebuffer,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:hublines,USE_ORIGINAL_NAME,Vector/Analysis
qgis:intersection,USE_ORIGINAL_NAME,Vector/Overlay
qgis:joinattributestable,USE_ORIGINAL_NAME,Vector/Selection
qgis:joinattributestable,USE_ORIGINAL_NAME,Vector/Table tools
qgis:lineintersections,USE_ORIGINAL_NAME,Vector/Lines
qgis:linestopolygons,USE_ORIGINAL_NAME,Vector/Lines
qgis:listuniquevalues,USE_ORIGINAL_NAME,Vector/Table tools
Expand All @@ -126,7 +125,6 @@ qgis:mergevectorlayers,USE_ORIGINAL_NAME,Vector/General tools
qgis:multiparttosingleparts,USE_ORIGINAL_NAME,Vector/General tools
qgis:nearestneighbouranalysis,USE_ORIGINAL_NAME,Vector/Points
qgis:pointslayerfromtable,USE_ORIGINAL_NAME,Vector/Creation
qgis:polygoncentroids,USE_ORIGINAL_NAME,Vector/Geometry operations
qgis:polygonfromlayerextent,USE_ORIGINAL_NAME,Vector/Creation
qgis:polygonstolines,USE_ORIGINAL_NAME,Vector/Polygons
qgis:randomselection,USE_ORIGINAL_NAME,Vector/Selection
Expand Down Expand Up @@ -197,9 +195,8 @@ saga:coordinatetransformationgrid,USE_ORIGINAL_NAME,Raster/General tools
saga:coordinatetransformationgridlist,USE_ORIGINAL_NAME,Raster/General tools
saga:coordinatetransformationshapes,USE_ORIGINAL_NAME,Vector/General tools
saga:coordinatetransformationshapeslist,USE_ORIGINAL_NAME,Vector/General tools
saga:countpointsinpolygons,USE_ORIGINAL_NAME,Vector/Polygons
saga:covereddistance,USE_ORIGINAL_NAME,Raster/Analysis
saga:creategraticule,USE_ORIGINAL_NAME,Vector/Miscellaneous
saga:creategraticule,Create graticule from extent,Vector/Creation
saga:croptodata,USE_ORIGINAL_NAME,Raster/General tools
saga:crossclassificationandtabulation,USE_ORIGINAL_NAME,Raster/General tools
saga:crossprofiles,USE_ORIGINAL_NAME,Domain specific/Terrain analysis and geomorphometry
Expand Down Expand Up @@ -341,7 +338,7 @@ saga:runningaverage,USE_ORIGINAL_NAME,Vector/Table tools
saga:sagawetnessindex,USE_ORIGINAL_NAME,Domain specific/Hydrology
saga:separatepointsbydirection,USE_ORIGINAL_NAME,Vector/Points
saga:shapesbuffer,USE_ORIGINAL_NAME,Vector/Geometry operations
saga:shapestogrid,USE_ORIGINAL_NAME,Raster - vector/Vector -> Raster
saga:shapestogrid,Rasterize vector layer,Raster - vector/Vector -> Raster
saga:simplefilter,USE_ORIGINAL_NAME,Raster/Filters
saga:simulation,Fire spreading simulation,Domain specific/Miscellaneous
saga:sinkdrainageroutedetection,USE_ORIGINAL_NAME,Domain specific/Hydrology
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/sextante/saga/SagaAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def processAlgorithm(self, progress):
filename = out.getCompatibleFileName(self)
filename2 = SextanteUtils.tempFolder() + os.sep + os.path.basename(filename) + ".sgrd"
if SextanteUtils.isWindows() or SextanteUtils.isMac():
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 4 -TYPE 0 -FILE \"" + filename + "\"");
else:
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 4 -TYPE 0 -FILE \"" + filename + "\"");

#4 Run SAGA
SagaUtils.createSagaBatchJobFileFromSagaCommands(commands)
Expand Down

This file was deleted.