mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
fix exception?
This commit is contained in:
parent
92d1cdc17a
commit
1a0d0dbb3f
@ -157,6 +157,8 @@ class RasterSampling(QgisAlgorithm):
|
|||||||
|
|
||||||
for n, i in enumerate(source.getFeatures()):
|
for n, i in enumerate(source.getFeatures()):
|
||||||
|
|
||||||
|
attrs = i.attributes()
|
||||||
|
|
||||||
if i.geometry().isMultipart():
|
if i.geometry().isMultipart():
|
||||||
raise QgsProcessingException(self.tr('''Impossible to sample data
|
raise QgsProcessingException(self.tr('''Impossible to sample data
|
||||||
of a Multipart layer. Please use the Multipart to single part
|
of a Multipart layer. Please use the Multipart to single part
|
||||||
@ -170,12 +172,12 @@ class RasterSampling(QgisAlgorithm):
|
|||||||
point = ct.transform(point)
|
point = ct.transform(point)
|
||||||
except QgsCsException:
|
except QgsCsException:
|
||||||
for b in range(sampled_raster.bandCount()):
|
for b in range(sampled_raster.bandCount()):
|
||||||
attrs.append(
|
attrs.append(None)
|
||||||
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()))
|
feedback.reportError(self.tr('Could not reproject feature {} to raster CRS').format(i.id()))
|
||||||
|
continue
|
||||||
attrs = i.attributes()
|
|
||||||
|
|
||||||
if sampled_raster.bandCount() > 1:
|
if sampled_raster.bandCount() > 1:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user