开发者

Mysql point data type & glength returns null

开发者 https://www.devze.com 2023-03-08 21:58 出处:网络
The following glength() statement returns null always. SET @mref_point1=point(12.937060,77.671280); SET @mref_point2=point(13.937060,73.271280);

The following glength() statement returns null always.

SET @mref_point1=point(12.937060,77.671280);
SET @mref_point2=point(13.937060,73.271280);

SELECT G开发者_运维知识库LENGTH(LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))));

Can someone point me in right direction.


I post this as an answer so the code can be read more easily:

Try narrowing down the problem by these steps:

select ASBINARY(@mref_point1)

If that does not return null go ahead and do:

select linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2))

If that does not return null go ahead and do:

select LINESTRINGFROMWKB(linestring(ASBINARY(@mref_point1),ASBINARY(@mref_point2)))
0

精彩评论

暂无评论...
验证码 换一张
取 消