1

I'm trying to use the geometry generator in symbology for a line layer. Specifically I want to smooth out the lines using smooth($geometry,5).

Unfortunately QGIS crashes every time I try to implement this. The data is stored in a GPKG. The GPKG contains other layers, but I have exported this particular layer to a separate GPKG file for testing.

It works fine if I export the lines to shapefile, but the data needs to be stored in a GPKG so I need to get this working.

Interestingly, the original GPKG file also contains a layer of polygons and I have successfully implemented the smooth($geometry,5) for these without any issues.

Happy to send through the GPKG file and see if someone can figure out what the problem is. I've run the geometry checker (Check Validity tool) on it and doesn't show any issues.

I'm running version 3.12.3 of QGIS.

enter image description here enter image description here

Crash Report:

Crash ID: 86223684825a81f552f396a7391a484f166dfa07  

Stack Trace
QVector::QVector qvector.h:358
QgsLineString::QgsLineString :
qgis::make_unique qgis.h:425
smoothCurve qgsgeometry.cpp:3091
QgsGeometry::smoothLine qgsgeometry.cpp:3177
QgsGeometry::smooth qgsgeometry.cpp:3046
fcnSmooth qgsexpressionfunction.cpp:2463
QgsStaticExpressionFunction::func qgsexpressionfunction.h:447
QgsExpressionFunction::run qgsexpressionfunction.cpp:102
QgsExpressionNodeFunction::evalNode qgsexpressionnodeimpl.cpp:901
QgsExpressionNode::eval qgsexpressionnode.cpp:29
QgsExpression::evaluate qgsexpression.cpp:373
QgsGeometryGeneratorSymbolLayer::render qgsgeometrygeneratorsymbollayer.cpp:200
QgsSymbol::renderUsingLayer qgssymbol.cpp:716
QgsLineSymbol::renderPolyline qgssymbol.cpp:1967
QgsSymbol::renderFeature qgssymbol.cpp:915
QgsFeatureRenderer::renderFeature qgsrenderer.cpp:130
QgsVectorLayerRenderer::drawRenderer qgsvectorlayerrenderer.cpp:328
QgsVectorLayerRenderer::render qgsvectorlayerrenderer.cpp:284
QgsMapRendererParallelJob::renderLayerStatic qgsmaprendererparalleljob.cpp:353
QtConcurrent::MapKernel::iterator,QtConcurrent::FunctionWrapper1 >::runIteration qtconcurrentmapkernel.h:69
QtConcurrent::MapKernel::iterator,QgsImageOperation::ProcessBlockUsingPixelOperation >::runIterations qtconcurrentmapkernel.h:78
QtConcurrent::IterateKernel::iterator,void>::forThreadFunction qtconcurrentiteratekernel.h:256
QtConcurrent::ThreadEngineBase::run :
QThreadPoolPrivate::reset :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :
   
QGIS Info
QGIS Version: 3.12.3-Bucure?ti
QGIS code revision: 8234261527
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 3.0.4
Running against GDAL: 3.0.4

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.18363

Happy to supply any other information as needed.

1
  • Link to GPKG file: link
    – Ben
    Jun 15, 2020 at 3:09

1 Answer 1

3

It appears the line layer in your gpkg is of CompoundCurveZ geometry and QGIS's smooth() function doesn't seem to play well with that.

When I saved your layer to LineStringZ/MultiLineStringZ geometry using QGIS, however, QGIS's geometry generator/field calculator still detects $geometry as being CompoundCurveZ/MultiCurveZ and crashes when smooth() is applied.

As an interim workaround, I "converted" the geometry to LineStringZ by simplifying it with a tolerance of 0:

smooth(simplify($geometry,0),5)

This produced smoothed results (blue) without crashing QGIS.

enter image description here

I suspect there is a bug in QGIS at play here.

1
  • Thank you so much she_weeds... Works perfectly. Really appreciate your help! I suspect you may well be correct regarding a possible QGIS bug.
    – Ben
    Jun 16, 2020 at 2:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.