我尝试插入
PolygonFromText("POLYGON((121.44842136764532 31.22119260287111,
121.45076025390631 31.221990825071376,
121.45402182006842 31.218366658611853,
121.45091045761114 31.217054584347302))")
作为类型为Polygon和Geometry类型的字段的值。
当我跑步时
SELECT PolygonFromText("POLYGON((121.44842136764532 31.22119260287111,
121.45076025390631 31.221990825071376,
121.45402182006842 31.218366658611853,
121.45091045761114 31.217054584347302))")
它返回 NULL
我的Mysql版本是5.1.41 - 我发现MySql文档很差,在这些情况下用户不友好
答案 0 :(得分:8)
我认为Polygon必须关闭,所以最后一组坐标应该与第一组相同。这将返回以下
SELECT PolygonFromText("POLYGON((121.44842136764532 31.22119260287111,121.45076025390631 31.221990825071376,121.45402182006842 31.218366658611853,121.45091045761114 31.217054584347302,121.44842136764532 31.22119260287111))");