geolocation

CakePHP putting quotes around function name in WHERE clause

大兔子大兔子 提交于 2019-12-24 04:59:16
问题 I'm using various functions from the earthdistance module in PostgreSQL, one of those being ll_to_earth . Given a latitude/longitude combination, I'm trying to retrieve the nearest point from my database via CakePHP 1.2.5 Stable. // set dummy data $latitude = 30.4393696; $longitude = -97.6200043; // create a simple bounding box in the WHERE conditions, sort the points by location, and retrieve the nearest point $location = $this->Location->find('first', array( 'fields' => array( 'id', 'coords

Find in which country each point-coordinate belongs to [duplicate]

狂风中的少年 提交于 2019-12-24 04:34:32
问题 This question already has answers here : Convert latitude and longitude coordinates to country name in R (2 answers) Closed 6 years ago . I have a data frame with lat/lon coordinates: head(COORD) LAT LON 1 69.34 16.17 2 69.20 17.92 3 69.59 17.87 4 69.17 18.52 5 69.42 18.95 6 69.22 18.91 I would like to to retrieve the country name of each point and add it as a third column. Maybe using which in combination with map to retrieve in which polygon the points are but I was not able to figure out

Is there any relationship between the reach estimate in Ads Manager and in the Ads API?

a 夏天 提交于 2019-12-24 03:18:42
问题 I just noticed that the numbers given by Ads API and the Ads Manager are wildly different. For instance, when searching for the French speakers in the city of Anderlecht, Belgium, the Ads Manager shows 44,000 people and the Ads API gives me the number 12,000 . See the screenshot of the Ads Manager UI and of the curl script calling below: curl -G -q \ -d 'targeting_spec={"geo_locations":{"cities": [{"key":"171194"}]},"locales":[1003]}' \ -d 'access_token=XYZ' \ https://graph.facebook.com/v2.3

SQL Server lat;lng varchar split procedure to use as Lat and Lng for speed Searching

依然范特西╮ 提交于 2019-12-24 02:43:27
问题 Can someone help me using a stored procedure or function to passing my stored varchar lat;lng in table to individuals fields as float as Lat and Lng to use in radius search. lanlng in Table 33.0000;15.222222 Thanks 回答1: Are you just trying to split the string? If so: declare @LatLng varchar(100) set @LatLng = '33.0000;15.222222' declare @Lat float declare @Lng float select @Lat = CAST(LEFT(@LatLng, charindex(';',@LatLng)-1) as float) select @Lng = CAST(SUBSTRING(@LatLng, charindex(';',@LatLng

How to parse the geolocation json from google for lng and lat in objective-c

怎甘沉沦 提交于 2019-12-24 02:23:56
问题 I'm creating a web request to pull lng and lat data based on zip (using the following url) http://maps.google.com/maps/geo?q=50266 Doing so I get back the following json { "name": "50266", "Status": { "code": 200, "request": "geocode" }, "Placemark": [ { "id": "p1", "address": "West Des Moines, IA 50266, USA", "AddressDetails": { "Accuracy" : 5, "Country" : { "AdministrativeArea" : { "AdministrativeAreaName" : "IA", "Locality" : { "LocalityName" : "West Des Moines", "PostalCode" : {

Geolocation method to see if user in specific area

…衆ロ難τιáo~ 提交于 2019-12-24 00:57:50
问题 i'm developing an application for a Restaurant in Portugal called Olivier. Currently I'm studying geolocation api of phonegap, and I haven't find a way to solve my problem that is to check if the user position is inside the restaurant. To be more specific I want my application to show a menu if the user is inside the restaurant area (trough geolocation) and to show a different menu if he's outside the restaurant area. I would be glad if you answer a link to a guide or just write the method i

How can I get the country and region code using geolocation instead of full country and region names

╄→尐↘猪︶ㄣ 提交于 2019-12-24 00:39:55
问题 I'm building a website that uses geolocation in HTML5 to provide a service specific to the region in which the user is. Here is what I have been doing: I use the Javascript in this SO question to get country and administrative region names. Then I search the country and region names in a database and it returns location-specific data that I can display. Here is the script: <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> var region = ""; var country = "";

Find if given lat-long lies in any of the polygon in MongoDB

别说谁变了你拦得住时间么 提交于 2019-12-23 21:19:48
问题 I want to know if I get a lat-long of a user and want to check if he lies in any of the polygon that is stored in my db (MongoDB). How can this be achieved using mongoDB. For instance my db will have 10 polygons stored as GeoJson objects. I get a lat-long and want to check if this lat-long lies in any of the 10 polygons in my DB. Can this be achieved in MongoDB? 回答1: I dont think your particular case can be achieved in MongoDB. MongoDB does have polygon calculations with the $polygon operator

How does mobile safari determine when to prompt user to share location?

╄→гoц情女王★ 提交于 2019-12-23 20:56:53
问题 I have a mobile web app where I want to track the latest location for a user, but only if they are in a certain area. But, having a little trouble with excessive prompts on the iPhone There's some location initialization code along the lines of: if (firstTime) { navigator.getCurrentPosition(function (coords) { if (coordsAreInTheBox) { storeCoordsForUser(); navigator.watchPosition(); } }); } else if (userInTheBox) { navigator.watchPosition(); } This works as expected on the first load, there

How can I tell when an MKOverlay is no longer within view?

孤街浪徒 提交于 2019-12-23 20:23:00
问题 MKMapViewDelegate's mapView:rendererForOverlay fires when an MKOverlay 's boundingMapRect enters the visible bounds of the MKMapView . Is there an equivalent delegate method that is fired when the MKOverlay leaves the map view's visible bounds? Or do I have to do this math myself? 来源: https://stackoverflow.com/questions/23147789/how-can-i-tell-when-an-mkoverlay-is-no-longer-within-view