geolocation

How to Parse XML data to a PHP variable

孤街浪徒 提交于 2019-12-07 13:24:16
问题 I am mediocre with php and ignorant with XML...if you can be detailed it will help me learn. I am attempting to use PHP programming to execute a scripts to this link... http://ws.geonames.org/postalCodeSearch?postalcode=VARIABLE_ZIP&country=US. The VARIABLE_ZIP is the actual zip code entered into the form that will submit the information in the link above. The output of that link creates an XML page that i do not want displayed anywhere on my website. What I want to do is capture the XML data

Android Geocoder - different results when called from different geographical locations

不问归期 提交于 2019-12-07 12:46:17
问题 I have the following code in my Android program List<Address> addressList = geoCoder.getFromLocation(37.790551,-122.433931, 1); if (!addressList.isEmpty()) { address = addressList.get(0); String number = address.getSubThoroughfare(); String streetName = address.getThoroughfare(); ..... } This is a request to essentially get a street name (hence the 1 ) from a latitude and longitude in San Francisco. When I execute this program on a phone in Europe (specifically Ireland) number is returned as

Google Maps Geocoding API - country biasing, bizarre results

情到浓时终转凉″ 提交于 2019-12-07 12:39:31
问题 I'm connecting to the Google Maps API from PHP to geocode some starting points for a rental station locator application. Those starting points don't have to be exact addresses; city names are enough. Geocoding responses with an accuracy equal to or grater than 4 (city/locality level) are used as starting points, and the surrounding rental stations searched. The application is supposed to work in Germany. When a locality name is ambiguous (i.e. there are more than one place of that name) I

get location when pages loads

心不动则不痛 提交于 2019-12-07 12:02:59
问题 I am Building a website useing HTML, CSS and Java script. I am wanting to get the location of the user when page loads. so they do not need to press a button. I was hoping some one can help. !DOCTYPE html> <html> <body> <p id="demo">Click the button to get your coordinates:</p> <button onclick="getLocation()">Try It</button> <script> var x=document.getElementById("demo"); function getLocation(){ if (navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPosition); } else{ x

Cordova geolocation plugin not getting location from GPS for Android

我是研究僧i 提交于 2019-12-07 11:56:50
问题 in my Cordova application, I am trying to get user's location from GPS. For that I am using Geolocation plugin. I need to get location after every 10 seconds. I am doing something like: navigator.geolocation.getCurrentPosition( $rootScope.onSuccessForLocation, $rootScope.onErrorForLocation_High, {maximumAge:600000, timeout:7000, enableHighAccuracy: true} ); Now when this code runs, it gives me location in callback method but its not coming from GPS as when app starts the GPS icon should

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 to plot geolocated RGB data faster using Python basemap

落爺英雄遲暮 提交于 2019-12-07 11:00:48
问题 I'm having an issue plotting an RGB image using Python's Basemap module with latitude and longitude data. Now, I am able to make the plots that I want, but the problem is how slow it is, since it is able to plot single channel data much faster than the RGB data, and in general, plotting RGB images on their own is also fast. Since I have lat/lon data, that is where things get complicated. I've checked out the solution to this problem: How to plot an irregular spaced RGB image using python and

Permission denied - geolocation in React Native

蹲街弑〆低调 提交于 2019-12-07 09:42:56
问题 I've been playing around with React Native, getting custom locations to work and setting the "NSLocationWhenInUseUsageDescription" key. The error, when running on the ios simulator, is this: { "code": 2, "message": "Unable to retrieve location.", "PERMISSION_DENIED": 1, "POSITION_UNAVAILABLE": 2, "TIMEOUT": 3 } This is what I have, pretty much straight from the Geolocation example page https://facebook.github.io/react-native/docs/geolocation.html /* eslint no-console: 0 */ 'use strict'; var

How do I query by geolocation in Laravel 5?

久未见 提交于 2019-12-07 09:33:43
问题 I am looking to add a geolocation attribute to my "Candidate" Eloquent model. I want to find Candidates based on their location. For instance, find all Candidates within 20 miles of San Francisco. What should my Eloquent model look like to store a Candidate's location in the database? How do I query for Candidates based on their location? I am using Laravel 5.3. 回答1: Personally, I have achieved this previously by storing a set of latitude and longitude coordinates. You can use something

Calculating heading of compass to a specific coordinate instead of to north

爷,独闯天下 提交于 2019-12-07 09:33:37
问题 I can't get this algorithm right. I'm trying to make a compass that points at a certain location instead of just pointing to, let's say, north. Something is wrong. I've spent a lot of time trying to figure this out, but i just can't find it. Any ideas? - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading{ double distanceEast = (location.longitude > 0 && otherLocation.longitude < 0) ? 180 - location.longitude + otherLocation.longitude - -180: