great-circle

MySQL Great Circle intersection (do two roads cross?)

点点圈 提交于 2019-12-02 12:10:48
MySQL OpenGIS CROSSES doesn't seem to work for me: SET @ls = 'LineString(1 1, 2 2, 3 3)'; SET @xx = 'LineString(0 2, 10 2)'; # SELECT AsText(EndPoint(GeomFromText(@ls))); select crosses(GeomFromText(@ls), GeomFromText(@xx)) returns 0 - expected 1 How would I rewrite this as a MySQL function? Bonus points for using lat, lon and spherical projection (and maybe the Great Circle.) PS I can't create tags and I have lost my old login: Useful tags would be: MySQL OpenGIS CROSSES greatcircle lat lon - :) Just use INTERSECTS(line1,line2) SET @ls = 'LineString(1 0,1 2)'; SET @xx = 'LineString(0 1, 2 1)'

Great Circle & Rhumb line intersection [closed]

扶醉桌前 提交于 2019-12-01 14:04:24
I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my Rhumb line. I am only interested in intersections that will occur with a few hundred kilometers so I do not need every possible solution. I have no idea where to begin. The simple answer is yes -- if you start from any lat/lon and continue traveling along some great circle, you will eventually cross any and all

Great Circle & Rhumb line intersection [closed]

瘦欲@ 提交于 2019-12-01 12:50:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my Rhumb line. I am only

MySQL Great Circle Distance (Haversine formula)

笑着哭i 提交于 2019-11-25 21:44:14
问题 I\'ve got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I\'d like to make it solely MySQL. Here\'s my current PHP Code: if ($distance != \"Any\" && $customer_zip != \"\") { //get the great circle distance //get the origin zip code info $zip_sql = \"SELECT * FROM zip_code WHERE zip_code = \'$customer_zip\'\"; $result = mysql_query($zip_sql); $row = mysql_fetch_array($result); $origin_lat = $row[\'lat\']; $origin_lon = $row[\'lon\']; //get