从存储的点创建几何图形(例如LineString()). MySQL空间 [英] Create geometry (f.e. LineString()) from stored points. MySQL spatial
本文介绍了从存储的点创建几何图形(例如LineString()). MySQL空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过MySQL查询(其中pt1,pt2,...
是另一个查询的结果,换句话说就是pt1,pt2,...
存储在MySQL表中)来创建某些几何图形(例如LineString(pt1,pt2,...)
)?
Is there any way to create some Geometry (f.e. LineString(pt1,pt2,...)
) from MySQL query (where pt1,pt2,...
is a result of another query, in other words pt1,pt2,...
stored in MySQL table)?
示例:SELECT LineString(SELECT point FROM points) AS line;
谢谢!
推荐答案
我遇到了类似的问题,并以此方式解决了该问题:
I had a similar problem and solved it in this way:
SELECT pt1, pt2, pt3, pt4, @Line_string := GEOMFROMTEXT(CONCAT('LINESTRING(',pt1,' ',pt2,', ',pt3,' ',pt4,')')) FROM table;
这篇关于从存储的点创建几何图形(例如LineString()). MySQL空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文