latitude-longitude

MySQL User Defined Function for Latitude Longitude Syntax

别说谁变了你拦得住时间么 提交于 2019-11-30 23:53:20
I have created a MySQL function to determine if a set of latitude and longitude coordinates are within a certain range of another set of latitude and longitude coordinates. However, the function is giving me a syntax error so I cannot test to see if it is working properly. Any help figuring out what is causing the error would be greatly appreciated. The function along with a description of it is written below: It works by having the starting lat/long coordinates passed to the function. The database contains the rows targa, targb, and targc, that contain the latitude, longitude, and range

Need to find latitude and longitude of postcodes and store into my database [closed]

二次信任 提交于 2019-11-30 23:29:49
I’ve got a database full of UK Postcodes, now I’d like to be able to store the latitude and longitude of these specific postcodes along with the record with the database. Is there any way that I can obtain this data free without violating any T&C's? I know I could do this using Google maps API for each postcode, but I have way over 20,000 postcodes in this database and to get the lat and lng for each of these postcodes each time is not an option really. Thanks in advance, M Ben Postcode location data is available free now. See this answer: https://stackoverflow.com/a/2625123/587803 https://www

get by latitude and longitude in laravel 5 with other joins

Deadly 提交于 2019-11-30 22:09:43
This is quite a complicated one for me. I have a route that is a search - which works quite well, except I am unable to search by postcode to find the nearest to the lat and long of a given postcode. That is, I can work out the lat and long, but I am not sure how to integrate it to my existing query. This query is the search query without postcodes: $query = DB::table('dogs'); $query->leftJoin('dog_addresses','dogs.id','=','dog_addresses.dog_id'); $query->leftJoin('dog_videos','dogs.id','=','dogs_videos.dog_id'); $query->leftJoin('dogs_breeds','dogs.breed_id','=','dogs_breeds.id'); if($request

How determine if point is within rectangle given all latitude/longitude coordinates?

做~自己de王妃 提交于 2019-11-30 19:09:08
问题 If given x/y coordinates for all 4 corners of rectangle, and then another x/y, it's easy to determine if the point is within the rectangle if top left is 0,0. But what if the coordinates are latitude/longitude where they can be negative (please see attached). Is there a formula that can work in this case? 回答1: Mathematicaly, you could use inequations to determine that. edit: When doing the example, i've noticed you put the coordinates in the inverse format (y,x) instead of (x,y). In my

How can I determine the distance between two sets of latitude/longitude coordinates?

ぃ、小莉子 提交于 2019-11-30 18:37:52
I am trying to write something that will determine the distance between to sets of lat/lon coordinates. I am using the following code which I found on this site : public static double distance (double lat1, double lon1, double lat2, double lon2) { double lat1 = Convert.ToDouble(latitude); double lon1 = Convert.ToDouble(longitude); double lat2 = Convert.ToDouble(destlat); double lon2 = Convert.ToDouble(destlon); double theta = toRadians(lon1-lon2); lat1 = toRadians(lat1); lon1 = toRadians(lon1); lat2 = toRadians(lat2); lon2 = toRadians(lon2); double dist = sin(lat1)*sin(lat2) + cos(lat1)*cos

MySQL User Defined Function for Latitude Longitude Syntax

£可爱£侵袭症+ 提交于 2019-11-30 18:24:44
问题 I have created a MySQL function to determine if a set of latitude and longitude coordinates are within a certain range of another set of latitude and longitude coordinates. However, the function is giving me a syntax error so I cannot test to see if it is working properly. Any help figuring out what is causing the error would be greatly appreciated. The function along with a description of it is written below: It works by having the starting lat/long coordinates passed to the function. The

Array contains latitude and longitude of a polygon in Google maps drawingManager

被刻印的时光 ゝ 提交于 2019-11-30 16:23:17
This is the most simplest way to add a drawing manager on the Google maps to draw polygon, circle, rectangle and etc by user. code: <html> <head> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=drawing"></script> <script> function initialize() { var map = new google.maps.Map(document.getElementById('map'), {zoom: 12, center: new google.maps.LatLng(32.344, 51.048)}); var drawingManager = new google.maps.drawing.DrawingManager(); drawingManager.setMap(map); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div

Convert decimal latitude/longitude coordinates to iPad screen coordinates

耗尽温柔 提交于 2019-11-30 15:51:36
I have a latitude/longitude decimal coordinates that I would like to convert to points that will fit within the area of the iPad coordinate system. My code takes in a latitude/longitude coordinates and converts them to cartesian coordinates (based on this question: convert to cartesian coordinates ) The results of the conversion are (2494.269287, 575.376465). Here is my code (no compile or runtime errors): #define EARTH_RADIUS 6371 - (void)drawRect:(CGRect)rect { CGPoint latLong = {41.998035, -116.012215}; CGPoint newCoord = [self convertLatLongCoord:latLong]; NSLog(@"Cartesian Coordinate: (%f

Calculate distance in (x, y) between two GPS-Points

一曲冷凌霜 提交于 2019-11-30 15:44:03
问题 I'm looking for a smooth way to calculate the distance between two GPS Points, so I get the result like: "You have to go x meters up and y meters to the left - so I can work with a 2d-coordinate system, where I have my position as (0,0) and the other positions is showing the distance in (x, y) in meters from my position. My idea was to calculate the distance between the points using the haversine formula. (This returns my hypotenuse) In addition to that, I'm calculating the bearing between

Intersection of two Moving Objects with Latitude/Longitude Coordinates

ε祈祈猫儿з 提交于 2019-11-30 15:42:37
This issue I can't really solve till now although I read through several articles already - hope somebody can help here. Facts (know variables): Two moving objects on earth surface, both with current know latitude/longitude coordinates. The speed of both objects is know as well (in m/s). The direction (angle) of one object is know. Now I want to calculate the direction (angle) of the second moving object needed to intersect with (hit) the other moving object. As the distance between the objects is small (in the range of only 5-20 km) and no very high accuracy is needed, it is OK to consider