latitude-longitude

Distance between two geo-points?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 19:42:30
问题 How do I get an accurate distance (in meters) given two geo-points (two latitude/longitude pair) ? Possible Duplicates: Distance Between Two GEO Locations Calculating the distance of geo locations Android calculate distance between two locations How to find distance from the latitude and longitude of two locations? 回答1: There's no distance measurement on the iPhone that will give you a resolution of 2 meters. You can use Core Location's -[CLLocation distanceFromLocation: otherLocation] method

PHP: How to create a Geo-Fence(bounding Box) using the Distance from a set of Coords

北战南征 提交于 2019-12-23 19:15:26
问题 How would i create the points of a Geo-Fence(bounding box) using lat and lon and a distance. I have the lat and lon of the center point I have the geofence distance. What would the logic be to create the geo-fence around these multiple points? thanks for any help. 回答1: 1 Convert center lat / lon to cartesian (x,y) in units meter. Then you do all geometry as you have learned in school: 2 Create one corner point of the square, using polar coordinates formula phi = 45 * TO_RADIANS; corner.x =

Computing latitude longitude center point of a Polygon in PHP

眉间皱痕 提交于 2019-12-23 10:25:56
问题 I have a set of points (stored as lat/lon) for a polygon, I want to compute the lat/lon center point of the polygon in PHP. Basically to do the same thing as the getCenter() function in Google Maps LatLngBounds. Any ideas on how I can achieve this? 回答1: What you are looking for is the centroid of the polygon - which is pretty easy to compute. If you are using latitude/longitude the matter is complicated by the fact the the polygon is actually on the surface of a sphere (ellipsoid). As an

Computing latitude longitude center point of a Polygon in PHP

强颜欢笑 提交于 2019-12-23 10:25:19
问题 I have a set of points (stored as lat/lon) for a polygon, I want to compute the lat/lon center point of the polygon in PHP. Basically to do the same thing as the getCenter() function in Google Maps LatLngBounds. Any ideas on how I can achieve this? 回答1: What you are looking for is the centroid of the polygon - which is pretty easy to compute. If you are using latitude/longitude the matter is complicated by the fact the the polygon is actually on the surface of a sphere (ellipsoid). As an

Passing Longitude and Latitude in Twitter Streaming API of Pakistan

痴心易碎 提交于 2019-12-23 10:02:47
问题 I am having problem in passing longitude and latitude format of Pakistan in Twitter Streaming API. This API provides some sample examples of passing longitude and latitude of some cities. The location for San Fransisco in the API location example is given below and it works very well in my program. -122.75,36.8,-121.75,37.8 But I am trying to use the following location to get tweets from Pakistan but the server rejects this location. 71.69,32.01,70.69,33.01 Kindly help me which 4 values

Which longitude/latitude adjustments do I need to enlarge my map to the northwest and to the southeast?

[亡魂溺海] 提交于 2019-12-23 06:07:14
问题 This is related to my earlier question I want to add a "shim" to my map so that the extreme pushpins aren't half-in bounds, half out-of-bounds. I'm on the right track (no pun intended), but my logic is faulty. I wrote this method: // Adapted from Brundritt and Boonaert: https://stackoverflow.com/questions/26937358/can-i-adjust-my-bing-maps-view-locationrect-bounding-box-by-a-small-amount public static Location GetAShimLocation(IList<Location> locations, bool IsForNorthwestCorner) { const

Calculating distance between 400 cities and optimizing MySQL for it?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 05:15:21
问题 I've got a database of around 400 cities. User selects a city in which he lives, and enters the distance which he is willing to travel (for example, 40kilometers). The city_id is stored into search table, with some other irrelevant information. When user submits the form, he's redirected to results page, on which all results from search table are shown, that meet the criteria, but I want to order them by the distance between city form user's city and the result city, and order the results by

Convert lat long string into google maps API LatLng Object

▼魔方 西西 提交于 2019-12-23 05:04:17
问题 I am trying to convert a lat long string (53.3603, -6.315050000000042) into a google maps object in this format: B: -6.26747649999993 k: 53.339251 I have used this function which works for the long but returns Nan for the lat. function getLatLngFromString(ll) { var lat = ll.replace(/\s*\,.*/, ''); // first 123 var lng = ll.replace(/.*,\s*/, ''); // second ,456 var locate = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); return locate; } ; I am storing the lat long in a html tag as

Convert lat long string into google maps API LatLng Object

余生长醉 提交于 2019-12-23 05:03:46
问题 I am trying to convert a lat long string (53.3603, -6.315050000000042) into a google maps object in this format: B: -6.26747649999993 k: 53.339251 I have used this function which works for the long but returns Nan for the lat. function getLatLngFromString(ll) { var lat = ll.replace(/\s*\,.*/, ''); // first 123 var lng = ll.replace(/.*,\s*/, ''); // second ,456 var locate = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); return locate; } ; I am storing the lat long in a html tag as

Find the average (center) of lats/lngs

烂漫一生 提交于 2019-12-23 04:37:36
问题 I am dynamically plotting several points onto a google map. I'm trying to find the best way to find the center of the given points. I've tried using the following: var mapArray = new Array; mapArray[0] = new Array(42, 35.391228, -119.008401); mapArray[1] = new Array(34, 33.874277, -118.131555); mapArray[2] = new Array(214, 32.6922592, -115.4962203); mapArray[3] = new Array(216, 33.3818875, -117.2449785); mapArray[4] = new Array(40, 36.805231, -119.770192); mapArray[5] = new Array(47, 37