I am trying to extract X and Y coordinates for specific point inside linestring, but without success. I want to get same results like when I am running SELECT X(POINT(56.7, 53.34)) query and get 56.7 result, but for linestring. Here is the example code:
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT AsText(PointN(GeomFromText(@ls),2));//here is the result POINT(2 2)
select X(AsText(PointN(GeomFromText(@ls),2))));//here I am expecting result 2, but I get null
Could anyone help me with this?
Thanks in advance!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.