geolocation

how to use direction angle and speed to calculate next time's latitude and longitude

荒凉一梦 提交于 2019-12-03 02:41:57
I have know my current position({lat:x,lon:y}) and I know my speed and direction angle; How to predict next position at next time? First, calculate the distance you will travel based on your current speed and your known time interval ("next time"): distance = speed * time Then you can use this formula to calculate your new position (lat2/lon2): lat2 =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc)) dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat2)) lon2=mod( lon1-dlon +pi,2*pi )-pi For an implementation in Javascript, see the function LatLon.prototype.destinationPoint on this page

Does Google offer an API that I can use to get the location of my phone?

狂风中的少年 提交于 2019-12-03 02:32:47
My smartphone reports my location to Google (to G+ and to the Android Device Manager). I'd like to read that location from a website/program to plot my location. I could use another app on my smartphone doing extra tracking but that tends to drain the battery quite a bit (having two apps do the tracking). Since Latitude was deprecated I can't seem to find a replacement. As part of Android Google is offering a location API . However, it sounds like you are looking for some kind of personal web API where you can get access to the location already sent to Google. I'm quite sure that it doesn't

Can iPhone web apps get GPS position?

老子叫甜甜 提交于 2019-12-03 02:04:37
问题 Is there an easy way to design a website to facilitate an iphone user providing gps coordinates to the site? I am wondering if there might be a naming convention for form fields for example, to let the user input in an automated way. I am considering building a location based website and would like to tailor it for iphone (and other mobile users). I realize an iphone app could do this but I'm not equipped to create one. 回答1: Here's a snippet on how to read location from the iPhone. Looks like

Find County name for a Lat/Long

独自空忆成欢 提交于 2019-12-03 01:44:50
I'm trying to find a webservice that will allow me to get a County name (not Country) for a specific Lat/Long. I would be performing the lookup within a server application (likely a Java application). It doesn't have a be a webservice if there is some library out there I suppose, but I would like up-to-date information. I have looked around quite a bit for an API that supports this, but so far I haven't been able to find one that works. I have tried the Yahoo APIs like so: http://where.yahooapis.com/geocode?q=39.76144296429947,%20-104.8011589050293 But it doesn't populate the address

Javascript or Python - How do I figure out if it's night or day?

隐身守侯 提交于 2019-12-03 01:26:32
any idea how I figure out if it's currently night/day or sunrise/dawn based on time and location of the user? I haven't found anything useful that I could use within either the client or backend. What makes it tricky is the hour doesn't necessarily define if it is night and day, this depends pretty much on the year, month, day, hour and geo coordinates. For clarification... to emulate something like this. A way to approximate this would be very useful as well. Hope that someone can help! You can do as I did and use this public domain Sun.py module to compute the position of the sun relative to

Find nearest latitude and longitude points

雨燕双飞 提交于 2019-12-03 01:24:46
An question on latitude and longitude...Probably a silly one. I have a set of latitude and longitudes for various locations.And, I have the latitude and longitude of the location in which I am in. Now,I have to find the nearest places from my locations from the set of latitudes and longitudes I have. Is thee any special way of calculating it or it is just mere subtraction and checking the difference? Could you please throw some light on this? Thanks, J It depends on how the points are placed. For example - if most of the points are in a parking lot, then Euclidean Distance should work well. In

current location is always null

匆匆过客 提交于 2019-12-03 00:50:09
I am trying to retrieve my current location on the button click in an editbox using gps or network..i have tried all possible methods which i found in tutorials and older posts....but my location is always null.. i am not getting where i am wrong.? i am testing it on real device having network but no internet/gprs... this is the code which i am using..i tried the same with GPS_PROVIDER as well ..please help me.. protected void showCurrentLocation() { geocoder = new Geocoder(this); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager

Best way to get user nearest city? Python/Django

試著忘記壹切 提交于 2019-12-03 00:45:29
I have a website with a limited number of cities in the database, and need to show the user the nearest city to his current location. I can get the location by MaxMind API, but I want to get the nearest city in my database to user city. For example, if I have these cities in the database: Los Angeles , San Francisco and New York City , and I'm accessing from other city like Miami , I should see NYC selected because it's the nearest geographically. What's the best way to do this quick and performance aware? You should store the approximate latitude and longitude for each city, calculate the

Polygon geofencing with iOS

那年仲夏 提交于 2019-12-03 00:29:20
I am trying to find a way to create several polygon geofences with iOS. I need to draw multiple zones in a city to represent areas, streets, etc. From what I've read so far, iOS only allows circular zone from a geolocated device. Is it feasible with iOS? Is there a web app somewhere to draw polygons on a map and generate the coordinates in an array? Laurent 1) iOS only allows to create circular geofences indeed however what you are trying to achieve is possible with some extra logic. I have developed similar features so I suggest you to do the following: create a circular geofence that embeds

How to Fetch the Geotag details of the captured image or stored image in Windows phone 8

随声附和 提交于 2019-12-02 23:59:05
I want to fetch the information from the image regarding the Geolocation as shown in the image below void cam_Completed(object sender, PhotoResult e) { if (e.TaskResult == TaskResult.OK) { Image cameraImage = new Image(); BitmapImage bImage = new BitmapImage(); bImage.SetSource(e.ChosenPhoto); cameraImage.Source = bImage; e.ChosenPhoto.Position = 0; ExifReader reader = new ExifReader(e.ChosenPhoto); double gpsLat, gpsLng; reader.GetTagValue<double>(ExifTags.GPSLatitude, out gpsLat)) reader.GetTagValue<double>(ExifTags.GPSLongitude, out gpsLng)) MessageBox.Show(gpsLat.ToString() + "" + gpsLng