[Qgis-developer] Multiple replacements in a string

Neumann, Andreas a.neumann at carto.net
Tue Aug 30 23:15:27 PDT 2016


Hi all, Hi Nyall, 

Came across https://twitter.com/northroadgeo/status/770490090724491265
demoing the replacements of multiple values at once through a nice GUI
where you can define a replacement map.  

I wonder if we couldn't have a more powerful replacement function like
this in the QGIS expressions as well, something like: 

replace(string, replacement_map) where replacement_map would be a
dictionary such as defined in the above tweet, e.g. 

replace(streetname,{'Road'->'Rd','Lane'->'Ln','Highway'->'Hwy'}) 

That way we could use it everywhere we want (not just in the labeling
part) and it would be much easier to write than having to nest multiple
replace() statements. 

Would this be achievable for QGIS 3.0? 

Thanks for your feedback, 

Andreas

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160831/e3a30174/attachment.html>


More information about the Qgis-developer mailing list