Bug report #5513

Field calculator doesn't work on MultiPoint geometry for the calculation of the coordinates X and Y

Added by Salvatore Larosa over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Data Provider
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:15116

Description

The following functions ($x and $y) return 0 value if geometry is Multipoint type:

static QVariant fcnX( const QVariantList& , QgsFeature* f, QgsExpression* )
{
  ENSURE_GEOM_TYPE( f, g, QGis::Point );
  return g->asPoint().x();
}
static QVariant fcnY( const QVariantList& , QgsFeature* f, QgsExpression* )
{
  ENSURE_GEOM_TYPE( f, g, QGis::Point );
  return g->asPoint().y();
}

Likely related to #5293

Associated revisions

Revision 4e70885d
Added by Alexander Bruy over 9 years ago

multipoint geometry support in Field Calculator (fix #5513)

History

#1 Updated by Alexander Bruy over 9 years ago

  • Status changed from Open to Closed

#2 Updated by Alexander Bruy over 9 years ago

  • Resolution set to fixed

Also available in: Atom PDF