Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix exception?
  • Loading branch information
ghtmtt committed Jul 16, 2018
1 parent 92d1cdc commit 1a0d0db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/plugins/processing/algs/qgis/RasterSampling.py
Expand Up @@ -157,6 +157,8 @@ def processAlgorithm(self, parameters, context, feedback):

for n, i in enumerate(source.getFeatures()):

attrs = i.attributes()

if i.geometry().isMultipart():
raise QgsProcessingException(self.tr('''Impossible to sample data
of a Multipart layer. Please use the Multipart to single part
Expand All @@ -170,12 +172,12 @@ def processAlgorithm(self, parameters, context, feedback):
point = ct.transform(point)
except QgsCsException:
for b in range(sampled_raster.bandCount()):
attrs.append(
None
)
attrs.append(None)
i.setAttributes(attrs)
sink.addFeature(i, QgsFeatureSink.FastInsert)
feedback.setProgress(int(n * total))
feedback.reportError(self.tr('Could not reproject feature {} to raster CRS').format(i.id()))

attrs = i.attributes()
continue

if sampled_raster.bandCount() > 1:

Expand Down

0 comments on commit 1a0d0db

Please sign in to comment.