I have multiple strings as below:
LINESTRING (-3.1 2.42, 5.21 6.1, -1.17 -2.23)
LINESTRING (1.83 9.5, 3.33 2.87)
The expected results are lists that contain corresponding coordinates in the tuple format:
[(-3.1,2.42),(5.21,6.1),(-1.17,-2.33)]
[(1.83,9.5),(3.33,2.87)]
Note that the number of coordinates in the string is unknown and variable. Now, I use the split function twice after removing characters outside the parenthesis. Is there any elegant way to exact the coordinates using Regex.