我正在尝试为线串内的特定点提取X和Y坐标,但没有成功。我希望得到相同的结果,例如当我运行SELECT X(POINT(56.7,53.34))查询并获得56.7结果时,但是对于线串。 以下是示例代码:
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
有人可以帮我吗?
提前致谢!