wkt

Run Settings
LanguagePython
Language Version
Run Command
# encoding: utf-8 import re s1=""" 121.651677477117 31.3356535990687 121.651671441881 31.3356569230189 121.651396002163 31.3356039288364 121.651349940836 31.33554112919 121.651262186142 31.3354189904255 121.651327310333 31.3351837898146 121.651366550272 31.3351628153179 121.651541910089 31.3350677693326 121.651814307072 31.335121072928 121.651953163705 31.3353058556916 121.651886645654 31.335539361219 121.651778519457 31.335598193999 121.651677477117 31.3356535990687 """ split = '([\s\S]*?)' pattern = '(121\.\d+' + split + '31\.\d+)' res = re.findall(pattern, s1) # points = [re.sub(split, ' ', item[0]) for item in res] points =[item[0].replace(item[1], ' ') for item in res] print('POLYGON ((%s))' % ','.join(points)) points = [item[0].replace(item[1], ',') for item in res] print('IECS %s' % ' '.join(points))
Editor Settings
Theme
Key bindings
Full width
Lines