Skip to content

Commit

Permalink
[sextante]fixed somes issues in ftools algorithms due to changes in v…
Browse files Browse the repository at this point in the history
…ector API
  • Loading branch information
volaya committed Mar 23, 2013
1 parent 9f6715b commit 9465afa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion python/plugins/sextante/algs/ftools/Buffer.py
Expand Up @@ -16,18 +16,19 @@
* *
***************************************************************************
"""
from sextante.core.QGisLayers import QGisLayers

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'


from PyQt4.QtCore import *

from qgis.core import *

from sextante.core.QGisLayers import QGisLayers
from sextante.core.SextanteLog import SextanteLog

def buffering(progress, writer, distance, field, useField, layer, dissolve, segments):
Expand Down
7 changes: 4 additions & 3 deletions python/plugins/sextante/algs/ftools/Intersection.py
Expand Up @@ -64,9 +64,10 @@ def processAlgorithm(self, progress):
geom = QgsGeometry( inFeatA.geometry() )
atMapA = inFeatA.attributes()
intersects = index.intersects( geom.boundingBox() )
for id in intersects:
vlayerB.featureAtId( int( id ), inFeatB , True)
tmpGeom = QgsGeometry( inFeatB.geometry() )
for i in intersects:
request = QgsFeatureRequest().setFilterFid(i)
inFeatB = vlayerB.getFeatures(request).next()
tmpGeom = QgsGeometry(inFeatB.geometry())
try:
if geom.intersects( tmpGeom ):
atMapB = inFeatB.attributes()
Expand Down
6 changes: 4 additions & 2 deletions python/plugins/sextante/algs/ftools/Union.py
Expand Up @@ -86,7 +86,8 @@ def processAlgorithm(self, progress):
else:
for id in intersects:
count += 1
vlayerB.featureAtId( int( id ), inFeatB , True)
request = QgsFeatureRequest().setFilterFid(id)
inFeatB = vlayerB.getFeatures(request).next()
atMapB = inFeatB.attributes()
tmpGeom = QgsGeometry( inFeatB.geometry() )

Expand Down Expand Up @@ -171,7 +172,8 @@ def processAlgorithm(self, progress):
raise GeoAlgorithmExecutionException("Feature exception while computing union")
else:
for id in intersects:
vlayerA.featureAtId( int( id ), inFeatB , True)
request = QgsFeatureRequest().setFilterFid(id)
inFeatB = vlayerA.getFeatures(request).next()
atMapB = inFeatB.attributes()
tmpGeom = QgsGeometry( inFeatB.geometry() )
try:
Expand Down

0 comments on commit 9465afa

Please sign in to comment.