MySQL Forums
Forum List  »  GIS

Re: How long is a piece of string?
Posted by: Andrew Dodson
Date: August 18, 2009 01:48PM

If it is degrees, then shouldn't this formula output 90?

--------
SET @pt1 = ASBINARY(GeomFromText('POINT(0 0)')), /** equator, meridian line */
@pt2 = ASBINARY(GeomFromText('POINT(90 90)')); /** north pole */

SELECT GLength(LineStringFromWKB(LineString(@pt1,@pt2))) AS distance;
--------
output
127.279

... which is equal to trig function SQRT(90^2 + 90^2), thats all this function is doing.



as expected this works
--------
SET @pt1 = ASBINARY(GeomFromText('POINT(0 0)')), /** equator, meridian line */
@pt2 = ASBINARY(GeomFromText('POINT(90 0)')); /** north pole */

SELECT GLength(LineStringFromWKB(LineString(@pt1,@pt2))) AS distance;
--------
output
90


How intolerable!

Options: ReplyQuote


Subject
Views
Written By
Posted
4366
August 18, 2009 10:51AM
2848
August 18, 2009 12:37PM
Re: How long is a piece of string?
3279
August 18, 2009 01:48PM
5284
August 19, 2009 05:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.