MySQL Forums
Forum List  »  GIS

Re: New openGIS functionality in MySQL available for testing
Posted by: John Powell
Date: April 21, 2008 06:46AM

Actually, the answer is 44.05 if you apply pythagoras's theorem to those 4 numbers. However, your point is a good one. The answer depends on the spatial reference system used when you create the geometry objects in question. The haversine formula is used for coordinates that are in lat/long, whereas pythagoras's theorem can only be used for coordinates that have been projected onto some local coordinate system.

As far as I know, MySQL does not currently take into account the spatial reference system when calculating distance. Your best bet would be to write your own custom distance function using haversine's formula. I have been tempted to write my own and submit it to MySQL, but have been so swamped by my current project (ironically, in lat/long) that I haven't even had time for further testing of the new GIS features this thread is about.

Options: ReplyQuote




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.