Bug report #3845

rule based renderer doesn't properly handle %

Added by Sandro Santilli over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Symbology
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:13903

Description

The rule based renderer doesn't accept % in the filter:

(edge_id % 10) = 1

Filter expression parsing error:
syntax error, unexpected Unknown_CHARACTER
name like 'some%'

Filter expression parsing error:
syntax error, unexpected Unknown_CHARACTER, expecting $end

History

#1 Updated by Sandro Santilli over 9 years ago

Fixed here:

The following changes since commit 2670283b06637e1d753bd2ee9076ce505d92792d:
  Radim Blazek (1):
        Merge branch 'master' of github.com:qgis/Quantum-GIS

are available in the git repository at:

  [email protected]:strk/Quantum-GIS.git bug3845

Sandro Santilli (1):
      Add support for modulo operator (%) in rule based rendering. See ticket #3845.

 src/core/qgssearchstringlexer.ll  |    2 +-
 src/core/qgssearchstringparser.yy |    1 +
 src/core/qgssearchtreenode.cpp    |    5 +++++
 src/core/qgssearchtreenode.h      |    1 +
 4 files changed, 8 insertions(+), 1 deletions(-)

#2 Updated by Sandro Santilli over 9 years ago

Note: my branch is rooted at master, not release_1_7_0

#3 Updated by Sandro Santilli over 9 years ago

Example style being possible with the fix:
http://strk.keybit.net/tmp/edge_style.qml

Would love to make it even more general by not hard-coding colors but rather reference offsets in a built-in palette, but that's offtopic in this ticket :)

#4 Updated by Sandro Santilli over 9 years ago

Oops, the pull request above had wrong repo uri (required an account).
This should be better: git://github.com/strk/Quantum-GIS.git
Branch name is still the same.

#5 Updated by Jürgen Fischer over 9 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Also available in: Atom PDF