Skip to content

Commit

Permalink
[sextante] fixed problem with projections when using file inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jul 9, 2013
1 parent 0d1ab81 commit dffbc16
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/plugins/sextante/core/GeoAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def resolveTemporaryOutputs(self):
SextanteUtils.setTempOutput(out, self)

def setOutputCRS(self):
layers = QGisLayers.getAllLayers()
layers = QGisLayers.getAllLayers()
for param in self.parameters:
if isinstance(param, (ParameterRaster, ParameterVector, ParameterMultipleInput)):
if param.value:
Expand All @@ -272,6 +272,14 @@ def setOutputCRS(self):
if layer.source() == inputlayer:
self.crs = layer.crs()
return
if (isinstance(param, ParameterRaster) or
(isinstance(param, ParameterMultipleInput) and param.datatype == ParameterMultipleInput.TYPE_RASTER)):
p = QgsProviderRegistry.instance().provider('gdal', inputlayer)
else:
p = QgsProviderRegistry.instance().provider('ogr', inputlayer)
if p is not None:
self.crs = p.crs()
return
qgis = QGisLayers.iface
self.crs = qgis.mapCanvas().mapRenderer().destinationCrs()

Expand Down

0 comments on commit dffbc16

Please sign in to comment.