Feature request #12482

Add random function with seed to expressions

Added by Olivier Dalang over 8 years ago. Updated over 6 years ago.

Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:20630


Hi !

When using data defined values, it's hard to use the rand() function, because a new random number is generated all the time.

A symbol with this as polygon fill color:
will be changing color at each redraw, making the map look like a disco party (not saying it's not nice ;) ).

Why not add another random function where one could specify a seed, so that the random number is always the same. Typically, one would use the feature's ID as the seed.
This way, the random color would always be the same, hopefully even across different setups.

Thanks !



#1 Updated by Nyall Dawson over 8 years ago

fYI the expressions+ plugin has a quasirand function which allows this.

#2 Updated by Olivier Dalang over 8 years ago

Oh that's very cool, didn't know about this. So it's about moving this to core ;)

#3 Updated by Giovanni Manghi over 6 years ago

  • Easy fix? set to No

Also available in: Atom PDF