MySQL Forums
Forum List  »  GIS

Patch to add useful distance
Posted by: Jesse Dailey
Date: May 04, 2008 06:38PM

After reading the OpenGIS for SQL specifications, it's apparent that there is a layer of Spatial Representation control that is still missing from MySQL.

This makes the Distance functions as implemented not very useful for what most people use GIS for: latitude and longitude on the earth's surface.

In the meantime, I have a patch that adds 2 functions: earth_distance_miles() and earth_distance_km() to the wl1326 branch.

To find the nearest X rows, on a database with 600k rows with a POINT column:
earth_distance_*() takes 3.04 seconds.
distance() takes 2.78 seconds.

If anyone would like a copy of the patch you can find it here: http://www.twintechs.com/blog/?p=15
UPDATE: link fixed, was 404. :(

Note, this assumes you are storing your POINT as POINT(latitude longitude). Which I understand is not how people expect this to be at some point in the future.



Edited 3 time(s). Last edit at 05/22/2008 05:42AM by Jesse Dailey.

Options: ReplyQuote


Subject
Views
Written By
Posted
Patch to add useful distance
5155
May 04, 2008 06:38PM


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.