MySQL has some powerful, and perhaps underused spatial extensions, but the most interesting functions are still unimplemented: “Note: Currently, MySQL does not implement these functions…â€
Among those as-yet unimplemented functions is DISTANCE(). Alternatives can be found here and here, though neither is clean or simple. I wonder if a simple MBRContains() is good enough, though…
Posted June 10, 2008 by Casey Bisson
Categories: Technology. Tags: distance, geolocation, mysql, MySQL spatial functions, spatial functions, unimplemented, workaround.
1 Comment(s)
Comments RSS
TrackBack Identifier URI
User contributed tags for this post:
mysql distance (296) - mysql spatial distance (273) - mysql geo distance (214) - mysql distance function (182) - mysql distance between points (159) - mysql distance between two points (99) - Mysql geo (93) - mysql gis distance (90) - mysql point distance (87) - MySQL Calculate distance (67) - distance mysql (66) - distance between points (65) - Geo Distance Search with mySQL (57) - mysql geolocation (52) - mysql geo functions (47) - geo distance mysql (41) - mysql coordinates (41) - distance between two points mysql (39) - mysql distance coordinates (38) - distance between coordinates (34) - mysql distance point (34) - mysql distance between 2 points (34) - mysql geo search (32) - What is the distance between the two points, (8,2) and (2,10)? (30) - mysql distance calculation (30) - calculating distance (29) - mysql distance search (26) - mysql distance between coordinates (26) - calculate distance between coordinates mysql (24) - mysql spatial distance between points (22) - mysql DISTANCE() (19) - calculate distance between coordinates (18) - MySQL Spatial Distance Function (18) - mysql distance points (18) - calculate distance mysql (17) - geolocation distance (17) - coordinates mysql (16) - mysql geodistance (16) - distance between two geo points (15) - mysql distance example (15) - mysql distance spatial (15) - distance spatial mysql (15) - mysql calculate distance between two points (15) - mysql distance two points (15) - geo distance php (14) - mysql distance function example (14) - mysql geo distance function (14) - php distance between coordinates (14) - mysql function distance (14) - geo mysql (14) - mySQL BETWEEN (13) - distance search mysql (13) - php geo distance (13) - distance between coordinates mysql (13) - mysql coordinate distance (13) - mysql linestringfromwkb (13) - calculating distances (12) - mysql geosearch (12) - mysql geo coordinates (12) - distance between two coordinates mysql (12) - spatial distance mysql (11) - point distance mysql (11) - distance function mysql (11) - php distance coordinates (11) - mysql distance geo (11) - mysql distance between two coordinates (11) - geo distance search mysql (11) - mysql spatial calculate distance (10) - mysql geo distance search (10) - mysql geometry distance (10) - distance() mysql (10) - mysql calculate distance between coordinates (10) - php geolocation distance (10) - mysql geolocation distance (10) - calculate distance between two points mySQL (10) - calculate distance between two point mysql (10) - MySQL GIS (9) - mileage between points (9) - mysql coordinates distance (9) - calculate distance geolocation (9) - mysql get distance (9) - distance in mysql (9) - distance between points php (9) - distance between points mysql (9) - mysql (8) - BETWEEN mysql (8) - distance between coordinate points (8) - mysql between example (8) - mysql earth distance (8) - MYSQL DISTANCE BETWEEN POINT (8) - mysql calculate distance spatial (8) - calculate distance in MySQL (8) - calculate distance between two coordinates mysql (8) - Geo-Distance-Search-with-MySQL (8) - geo search mysql (8) - mysql distance coordinate (8) - between in Mysql (7) - mysql calculate fields (7) - calculating distance between coordinates (7) - calculating distances between places (7) - mysql distance between two point (7) - point mysql (7) - between function in mysql (7) - Calculating Distance in GIS (7) - mysql function calculate distance (7) - MySQL between function (7) - mysql calculating distance (7) - calculating distance mysql (7) - php calculate distance (7) - Distance function for MySQL (7) - mysql calculate distance coordinates (7) - distance gis mysql (7) - distance between 3 points (7) - geolocation distance calculation (7) - calculating distance between two coordinates mysql (7) - spatial mysql distance (7) - mysql gis functions (7) - mysql calculate distance by coordinates (7) - distances between points (6) - calculate distances (6) - mysql calculate distance between points (6) - distance points MySQL (6) - calculating coordinate points (6) - php mysql calculate distance (6) - function distance mysql (6) - calculate distance coordinates mysql (6) - distance mysql gis (6) - mysql spatial extensions distance (6) - distance mysql spatial (6) - mysql geo function (6) - distance between 2 points mysql (6) - DISTANCE FUNCTION IN MYSQL (6) - google maps mysql distance (6) - mysql spatial calculating distance in miles (6) - distance calculation in mysql (6) - mysql spatial distance() (6) - php geo coordinate distance (6) - computing distance mysql spatial (6) - mysql find distance between two points (5) - mysql distance() gis (5) - geolocation mysql (5) - mysql GIS calculate distance (5) - mysql calculate (5) - mysql calculate distance between 2 points (5) - mysql calculate distance geo (5) - distance between.in (5) - mysql points distance (5) - google maps distance mysql (5) - calculating distance in mysql (5) -
There’s an example of distance calculation in the mysql manual – the trick is to make a line out of the two points and then get the length of the line:
ROUND(GLength(LineStringFromWKB(LineString(AsBinary(point1), AsBinary(point2)))))
http://dev.mysql.com/tech-resources/articles/4.1/gis-with-mysql.html
Thanks for your work – saved me a bit of digging!