Bug report #19704

Function is_closed() is not working

Added by Zoran Petrovic about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Geometry
Affected QGIS version:3.2.2 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27529

Description

When using Select by expression or Field calculator, function is_closed is not working.
For example:

this works:

CASE WHEN
x(start_point($geometry)) = x(end_point($geometry))
AND
y(start_point($geometry)) = y(end_point($geometry))
THEN 'closed' END

but this doesn't:

CASE WHEN
is_closed($geometry)
THEN 'closed' END

Associated revisions

Revision e5e14dd6
Added by Nyall Dawson about 6 years ago

Fix is_closed (and other expression functions) fail with multi* input geometries

Fixes #19704

Revision c9442a9f
Added by Nyall Dawson about 6 years ago

Fix is_closed (and other expression functions) fail with multi* input geometries

Fixes #19704

(cherry picked from commit e5e14dd68072473ade0f747034b63c6f89d88a1c)

History

#1 Updated by Nyall Dawson about 6 years ago

Can you share the wkt for some geometries this fails for?

#2 Updated by Zoran Petrovic about 6 years ago

Nyall Dawson wrote:

Can you share the wkt for some geometries this fails for?

Here is the sample (EPSG 3908):

MultiLineString ((6501338.13976828 4850981.51459331, 6501343.09036573 4850984.01453377, 6501338.13976828 4850988.96491092, 6501335.63971657 4850984.01453377, 6501338.13976828 4850981.51459331))

MultiLineString ((6501793.14917959 4851116.51137828, 6501798.09977704 4851119.01131875, 6501793.14917959 4851120.67794572, 6501791.48247845 4851119.01131875, 6501793.14917959 4851116.51137828))

MultiLineString ((6502558.16500301 4851122.3445727, 6502563.11560045 4851124.01119967, 6502558.16500301 4851128.96157683, 6502553.21440556 4851124.01119967, 6502558.16500301 4851122.3445727))

Is_closed is probably having issues with the MultiLineString type.

#3 Updated by Nyall Dawson about 6 years ago

  • Status changed from Open to In Progress

#4 Updated by Nyall Dawson about 6 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#5 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF