latitude-longitude

location (lat long) using facebook api

丶灬走出姿态 提交于 2019-12-07 11:33:31
问题 Is there a way to get the location of a user in (latitude and longitude format) using facebook api?? I am able to get the location name and other attributes but not the lat long of the place. Is there any API for the same in javascript. 回答1: If you have the user's basic info, one of the fields is location "location": { "id": "104146386288393", "name": "Newton, Massachusetts" }, You can make another query using the id of the location to return JSON containing lat/lon of the city, e.g. { "id":

How get the current latitud and longitud without use getLastKnownLocation method in Android?

社会主义新天地 提交于 2019-12-07 09:48:42
问题 I am trying to get the current position of the phone, for this I use the GPSTracker tutorial, the problem is always use the method getLastKnownLocation and return older position. if (isNetworkEnabled) { locationManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); Log.d("Network", "Network"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location !=

Finding nearest places using point datatype and st_distance_sphere in MySQL 8

邮差的信 提交于 2019-12-07 08:53:41
问题 I have a table called place : id | name | coordinates (longitude, latitude) 1 | London | -0.12574, 51.50853 2 | Manchester | -2.25, 53.41667 3 | Glasgow | -4.25, 55.86667 The coordinates column is of the point datatype . I inserted the points into the place table using: st_geomfromtext('point($longitude $latitude)', 4326) Notice that I've made use of the SRID. Given any coordinates, I'd like to find the nearest places to it (order by ascending). The solution I have currently come up with (by

Python lat/long midpoint calculation gives wrong result when longitude > 90

删除回忆录丶 提交于 2019-12-07 08:25:17
问题 I have a problem with a short function to calculate the midpoint of a line when given the latitude and longitude of the points at each end. To put it simply, it works correctly when the longitude is greater than -90 degrees or less than 90 degrees. For the other half of the planet, it provides a somewhat random result. The code is a python conversion of javascript provided at http://www.movable-type.co.uk/scripts/latlong.html, and appears to conform to the corrected versions here and here.

How to add lines of longitude and latitude on a map using ggplot2?

风格不统一 提交于 2019-12-07 08:17:15
问题 I am now plotting the map of Canada using ggplot2 . Because the default projection method is "aea"(Albers Equal Area), so the longitude and latitude are straight lines on the map. I wonder how I can display the longitude and latitude in the form of "110W, 100W, 90W" and "50N, 60N, 70N" on the map. They should be curves. Thanks a lot. The arcgis shapfile is downloaded from https://www.arcgis.com/home/item.html?id=dcbcdf86939548af81efbd2d732336db library(ggplot2) library(rgdal) countries<

FUNCTION ST_Distance_Sphere does not exist in MariaDB

青春壹個敷衍的年華 提交于 2019-12-07 06:42:57
问题 I want get all locations around my location but the function ST_Distance_Sphere does not work. My query: select *, astext(location) as location from `locations` where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) < 1000 Error : SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION app.ST_Distance_Sphere does not exist (SQL: select *, astext(location) as location from `locations` where ST_Distance_Sphere(location, POINT(35.905069591297, 49.765869174153)) <

How to find distance (by road) between 2 geo points in Android application?

别来无恙 提交于 2019-12-07 06:32:14
问题 I am developing an Android application. I need to find the distance between two geo coordinates. I used Location.distanceBetween() and Location.distanceTo() functions. These functions give the straight distance, but the actual distance is different when we travel by road. I want the distance between two geo points when the user travels by road. Does anyone know how to do this? 回答1: Use Directions API to get a "route" from GeoPoint X to GeoPoint Y. You'll get a list of points, that represent

Offset LatLng by some amount of meters in Android

时间秒杀一切 提交于 2019-12-07 06:17:21
问题 I have a LatLng object and I want to shift it's coordinates 500 meters to the east. I couldn't find a built-in method for that. I've seen https://gis.stackexchange.com/a/2964 but my results are just too inaccurate (about 15%) to use practically. How can I make a precise shift in meters? Note: I am NOT looking for shifting a Google Maps camera, I know how to do that. I've tried: static final double KILOMETERS_PER_DEGREE = 111.111; static LatLng offsetLongitude(LatLng initialCoords, float

How Do I Calculate the Area of a Polygon in a MySQL Database When the Polygon's Points are Lat Longs?

我的未来我决定 提交于 2019-12-07 05:53:35
问题 How do I calculate the area of a polygon stored in a MySql database? The polygons' points are lat longs. So, degrees and minutes seem to be causing a problem. I've tried: SELECT AREA( my_polygon ) FROM `my_table` WHERE name = 'Newport' Because, the points are lat longs, I get weird results. (I'm not able to switch to Postgre). Is there a way to do this in MySQL? I'd like to get the results in sq. meters or sq. km or sq. miles-- any of these would be fine. 回答1: You've got to transform those

Flickr API for location based images

╄→尐↘猪︶ㄣ 提交于 2019-12-07 05:02:32
问题 I want to get images of cities when city name is entered in search field in iOS. I am using flickr API but whenever I enter any longitude and latitude values, I only get returned an empty array. What should I do. I am using this URL: http://api.flickr.com/services/rest/?method=flickr.photos.geo.photosForLocation&api_key=e3d577010e5979a2ad2a22714abd901e&lat=40.6700&lon=73.9400&format=json&nojsoncallback=1&auth_token=72157638668602974-e1a3a3aa1e6d3dd8&api_sig=a0233b016c863b1662aeb21a664c351a