Skip to content

Instantly share code, notes, and snippets.

@CEZERT
Created March 17, 2022 11:00
Show Gist options
  • Save CEZERT/ceb62147f811839138bba2af5d8345c9 to your computer and use it in GitHub Desktop.
Save CEZERT/ceb62147f811839138bba2af5d8345c9 to your computer and use it in GitHub Desktop.
from qgis.core import *
from qgis.gui import *
@qgsfunction(args='auto', group='Custom')
def findreplace(s, feature, value):
chars = [('Â', '')
,('Ê', 'E')
,(' Î', 'I')
,('Ô', 'O')
,('Û', 'U')
,('Ä', 'A')
,('Ë', 'E')
,('Ï', 'I')
,('Ö', 'O')
,('Ü', 'U')
,('æ', 'oe')
,('À', 'A')
,('Æ','AE')
,('Ç','C')
,('É','E')
,('È','E')
,('Œ','OE')
,('Ù','U')
,('¿','OE')]
for char, replacewith in chars:
s = s.replace(char, replacewith)
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment