Message-ID: <CAGZnXNBmrM4X5zdZC94zMryeqD1VZbXWiYR2fL4M51LWvxVdzg@mail.gmail.com>
Date: 2015-04-20T10:01:51Z
From: Marcos Angelini
Subject: extract X, Y coordinates from (points) POSTGIS coordinates (WKT
Hi community,
I have a data frame of points with coordinates (WKT) in one column. It is
d <- as.data.frame(NULL)
d$xy <- c("POINT (-59.900833 -34.869722)", "POINT (-60.009032477477234
-34.71350213192503)", "POINT (-60.13337136105485 -34.74472597084807)",
"POINT (-60.199859958706185 -34.7384738077165)")
I want to convert this into:
d$X
-59.900833
-60.009032
-60.133371
-60.199860
d$Y
-34.869722
-34.713502
-34.744726
-34.738474
I've tried with gsub() but I'm not handy with regular expressions. Could
you help me, please?
Marcos.
[[alternative HTML version deleted]]