mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-14 00:08:51 -05:00
Fix GeometryCollect aggregate detection of geometry result type when running from external python applications
This commit is contained in:
parent
b0994a5574
commit
23ed6e9cd0
@ -101,6 +101,13 @@ QVariant QgsAggregateCalculator::calculate( QgsAggregateCalculator::Aggregate ag
|
||||
//determine result type
|
||||
QVariant::Type resultType = QVariant::Double;
|
||||
if ( attrNum == -1 )
|
||||
{
|
||||
if ( aggregate == GeometryCollect )
|
||||
{
|
||||
// in this case we know the result should be a geometry value, so no need to sniff it out...
|
||||
resultType = QVariant::UserType;
|
||||
}
|
||||
else
|
||||
{
|
||||
// evaluate first feature, check result type
|
||||
QgsFeatureRequest testRequest( request );
|
||||
@ -120,6 +127,7 @@ QVariant QgsAggregateCalculator::calculate( QgsAggregateCalculator::Aggregate ag
|
||||
QVariant v = expression->evaluate( context );
|
||||
resultType = v.type();
|
||||
}
|
||||
}
|
||||
else
|
||||
resultType = mLayer->fields().at( attrNum ).type();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user