Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
7 additions
and
5 deletions.
-
+7
−5
python/plugins/processing/algs/qgis/RasterSampling.py
|
@@ -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 |
|
@@ -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: |
|
|
|
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.