Skip to content
Permalink
Browse files

[sextante] algorithm fixes

  • Loading branch information
volaya committed Jul 9, 2013
1 parent 1c2e49e commit 0d1ab81a0891a5e6a034298c4207b70666fa9dd2
@@ -68,25 +68,21 @@ def processAlgorithm(self, progress):
request = QgsFeatureRequest().setFilterFid(i)
inFeatB = vlayerB.getFeatures(request).next()
tmpGeom = QgsGeometry(inFeatB.geometry())
try:
if geom.intersects( tmpGeom ):
atMapB = inFeatB.attributes()
int_geom = QgsGeometry( geom.intersection( tmpGeom ) )
if int_geom.wkbType() == 7:
int_com = geom.combine( tmpGeom )
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
try:
outFeat.setGeometry( int_geom )
attrs = []
attrs.extend(atMapA)
attrs.extend(atMapB)
outFeat.setAttributes(attrs)
writer.addFeature( outFeat )
except:
raise GeoAlgorithmExecutionException("Feature exception while computing intersection")
except:
raise GeoAlgorithmExecutionException("Geometry exception while computing intersection")
if geom.intersects( tmpGeom ):
print "hola"
atMapB = inFeatB.attributes()
int_geom = QgsGeometry( geom.intersection( tmpGeom ) )
if int_geom.wkbType() == 7:
int_com = geom.combine( tmpGeom )
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
outFeat.setGeometry( int_geom )
attrs = []
attrs.extend(atMapA)
attrs.extend(atMapB)
outFeat.setAttributes(attrs)
writer.addFeature( outFeat )



del writer
@@ -24,9 +24,7 @@
__revision__ = '$Format:%H$'

from PyQt4.QtCore import *

from qgis.core import *

from sextante.core.GeoAlgorithm import GeoAlgorithm
from sextante.core.QGisLayers import QGisLayers
from sextante.parameters.ParameterVector import ParameterVector
@@ -25,6 +25,7 @@

import os
from PyQt4 import QtGui
from qgis.core import *
from sextante.core.GeoAlgorithm import GeoAlgorithm
from sextante.parameters.ParameterString import ParameterString
from sextante.parameters.ParameterRaster import ParameterRaster
@@ -75,7 +76,7 @@ def processAlgorithm(self, progress):
noData = str(self.getParameterValue(translate.NO_DATA))
expand = str(self.getParameterFromName(translate.EXPAND).options[self.getParameterValue(translate.EXPAND)])
projwin = str(self.getParameterValue(translate.PROJWIN))
srs = self.getParameterValue(translate.SRS)
crsId = self.getParameterValue(translate.SRS)
sds = self.getParameterValue(translate.SDS)
extra = str(self.getParameterValue(translate.EXTRA))

@@ -101,9 +102,9 @@ def processAlgorithm(self, progress):
arguments.append(regionCoords[3])
arguments.append(regionCoords[1])
arguments.append(regionCoords[2])
if srs is not None:
if crsId is not None:
arguments.append("-a_srs")
arguments.append(str(srs))
arguments.append(str(crsId))
self.crs = QgsCoordinateReferenceSystem(crsId)
if sds:
arguments.append("-sds")

0 comments on commit 0d1ab81

Please sign in to comment.
You can’t perform that action at this time.