Skip to content
Permalink
Browse files
fix rasterize mesh when there is no data
  • Loading branch information
vcloarec authored and nyalldawson committed Jun 10, 2021
1 parent 5864629 commit a1ec4585018ad05d6cf010986768feb15128bb49
Showing with 17 additions and 13 deletions.
  1. +17 −13 src/analysis/processing/qgsalgorithmexportmesh.cpp
@@ -834,20 +834,24 @@ QVariantMap QgsMeshRasterizeAlgorithm::processAlgorithm( const QVariantMap &para
if ( feedback )
QObject::connect( &rasterBlockFeedBack, &QgsFeedback::canceled, feedback, &QgsFeedback::cancel );

QgsRasterBlock *block = QgsMeshUtils::exportRasterBlock(
mTriangularMesh,
dataGroup.datasetValues,
dataGroup.activeFaces,
dataGroup.metadata.dataType(),
mTransform,
pixelSize,
extent,
&rasterBlockFeedBack );


if ( dataGroup.datasetValues.isValid() )
{
QgsRasterBlock *block = QgsMeshUtils::exportRasterBlock(
mTriangularMesh,
dataGroup.datasetValues,
dataGroup.activeFaces,
dataGroup.metadata.dataType(),
mTransform,
pixelSize,
extent,
&rasterBlockFeedBack );

rasterDataProvider->writeBlock( block, i + 1 );
rasterDataProvider->setNoDataValue( i + 1, block->noDataValue() );
}
else
rasterDataProvider->setNoDataValue( i + 1, std::numeric_limits<double>::quiet_NaN() );

rasterDataProvider->writeBlock( block, i + 1 );
rasterDataProvider->setNoDataValue( i + 1, block->noDataValue() );
if ( feedback )
{
if ( feedback->isCanceled() )

0 comments on commit a1ec458

Please sign in to comment.