geolocation

How to randomly select a point on the surface of the Earth?

旧街凉风 提交于 2019-12-04 11:48:19
As the title says, how to randomly select a coordinate on the surface of the Earth without bias? The simple solution of doing rand(-90,90),rand(-180,180) will favor polar regions over equatorial regions. It sounds like you're looking for a uniform random distribution on a sphere . In spherical coordinates: θ = 2π * rand(0,1) Φ = arccos(1 - 2*rand(0,1)) Archimedes proved a nifty theorem that the area of a region on a sphere is equal to the area of the horizontal projection of that region onto the curved face of a circumscribing cylinder (and hence in particular, the area of the whole sphere is

Windows Phone 7 Emulator Location Data Format

若如初见. 提交于 2019-12-04 11:15:12
I am looking for a format of the location data used by the Windowws Phone Emulator Additional Tools. On the tab "Location" there is an option to save/open recorder data. I ask this question because I need simulate geo position change but Location Tab doesn't work for me. As a workaround I am going to create a file of the location data and open it in the emulator. It's a simple XML file in this format: <?xml version="1.0" encoding="utf-8"?> <WindowsPhoneEmulator xmlns="http://schemas.microsoft.com/WindowsPhoneEmulator/2009/08/SensorData"> <SensorData> <Header version="1" /> <GpsData latitude=""

Location and distance calculation using Wifi in android

江枫思渺然 提交于 2019-12-04 11:07:24
How to get the distance of our mobile device from a wifi hotspot kept inside a building? This is basically for navigational purposes inside the building.. Any help would be appreciated. If you want to use WiFi for indoor location (step 1 before navigation), then distance to the WiFi Access Points is not the correct approach. Instead use RSSI . With Android you would need to take WiFi fingerprint of a building by moving around every few meters and sample the RSSI strength . You need to provide a user interface that lets the user manually specify on an image of the building (e.g. a CAD drawing).

Working with the Google Location API

前提是你 提交于 2019-12-04 10:54:31
问题 Forgive me for my ignorance, but after several hours of searching, I'm having little luck. Anyway, I am attempting to write a small desktop application that will allow a user to enter an address and then have their approximate location returned in GPS coordinates. From what I can tell, Google provides a geocoding API[1] that allows requests in the following form: http://maps.googleapis.com/maps/api/geocode/output?parameters While I'm familiar with writing basic C Sharp applications, I really

Worldwide location (country, region, city) select plugin for Rails, jQuery or Google Maps API?

风格不统一 提交于 2019-12-04 10:50:02
问题 Is there any plugin which will help to create a dropdown menus for countries, regions and cities? At first user chooses country, then he has his region dropdown menu updated according to which country he has chosen, he chooses region and after that from 3rd menu a city. Plugin can be either for Ruby on Rails, jQuery or maybe javascript solution through google maps api? 回答1: The Freebase Suggest jQuery plug-in provides pretty slick auto-complete functionality that provides suggestions in a

How to calculate distance between 2 coordinates below a certain threshold in R?

混江龙づ霸主 提交于 2019-12-04 10:39:25
I have 44,000 US Zip codes and it's corresponding centroid lat/long in R. This is from the package 'zipcode' in R. I need to calculate the distance between each zipcode and keep those distances that are less than 5 miles. The problem is to calculate all distances between the zipcodes I have to create a vector of size 44,000x44,0000 which I can't due to space issues. I checked through the posts in R, the closest to my requirement is one that spits out the minimum distance between 2 datasets with lat/long DB1 <- data.frame(location_id=1:7000,LATITUDE=runif(7000,min = -90,max = 90),LONGITUDE

How I can get current geographical location of the device programatically

末鹿安然 提交于 2019-12-04 10:16:15
I need to get the device's current geographical location. Scenario : if I am in US ..: my device location should be US Same as in the case, when I am in UK : my device location should be UK I need the sample code for finding this geographical location. (location determined by Network Location Provider ) Craigy If you want to get the current country code, you want to look into Geocoder which you can use to get an Address which provides a getCountryCode method. Something like this Geocoder geocoder = new Geocoder(this); List<Address> addresses = null; try { addresses = geocoder.getFromLocation(

Beep not working when phonegap app is in background on iOS

纵然是瞬间 提交于 2019-12-04 09:55:12
I’m working on the iOS version of my phonegap-based navigation app. My app tracks the user’s location around a walk route using GPS and alerts the user using audio (navigator.notification.beep) and tactile (navigator.notification.vibrate) feedback when they reach a location at which there’s new instructions for them to follow. When my app is running in the foreground, both the audible beep and the vibration fire on reaching the geographic location but when the app is paused in the background, either by pressing the power button to turn the screen off or pressing the home button to return to

Preventing annoying HTML5 geolocation alerts inside UIWebView

北城以北 提交于 2019-12-04 09:27:00
问题 Whenever an script requests the geolocation using HTML5 's geolocation API, the UIWebView asks for a permission to use the iOS location services. This is pretty annoying, specially when you load static HTML files, it keeps asking the permission for each file, even if the user already granted this permission for the app itself. Is there a way to prevent it? I know that on safari the permission for geolocation is based on the domain and I agree on asking for permission when the request is done

How to write/get latitude longitude with image in uiimagepickercontroller?

ぃ、小莉子 提交于 2019-12-04 08:34:12
Currently I am saving and image with the following method in "saved photos album". UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); Now I want to associate the current latitude and longitude with that image. How can I do so ? Can I do with its mediaInfo dictionary (metadata). I am working in ios sdk 3.0 . Please tell me How to get /set geo data with an image in UIImageViewPickerController AFAIK this is not supported in iOS 4.0 and lower. As of iOS 4.1, you can use -[ALAssetsLibrary writeImageToSavedPhotosAlbum:metadata:completionBlock:]