geolocation

IPhone - SQLite distance by Latitude and Longitude

纵饮孤独 提交于 2019-12-03 14:09:45
I have a embedded database in my app that has all Latitude and Longitude of some interested points and I need to know my distance from these points(get my position using GPS). My problem is: I've just figured out that SQLite can't calculate distance using the query that I have because it doesn't calculate trigonometry functions(SIN, COS...). I was trying to avoid calculating these distances programatically using this query: NSLog(@"SELECT ((ACOS(SIN(%@ * PI() / 180) * SIN(lat * PI() / 180) + COS(%@ * PI() / 180) * COS(lat * PI() / 180) * COS((%@ – lon) * PI() / 180)) * 180 / PI()) * 60 * 1

Can I detect when my service is killed by “Advanced Task Killer”

核能气质少年 提交于 2019-12-03 13:56:05
My app runs a geolocalisation service that the user can active or disactive by a toggleButton. To check the status of the service, I write a boolean in the Shared Preferences. I listen the beginning of the service and the end of it thanks to the onDestroy() of my service. My problem is that: When the user kill the service with the "advanced task killer", I can't know that the service is killed, the onDestroy is not called ! How can I deal with that? Thanks for your help. Florent When a process is killed (using ATK or android's own force stop button, or the function here ), it is immediately

javascript Latitude Longitude to xyz position on earth (threejs)

吃可爱长大的小学妹 提交于 2019-12-03 13:50:57
问题 i´m playing arround with three.js i want to render objects on specific geocoordinates on a bigger sphere, i´m pretty near to the solution, but i dont get the correct xyz position from lat lon i have set up a test case on jsfiddle, there are two coordinates latlons = [[40.7142700,-74.0059700], [52.5243700,13.4105300]]; its New York and Berlin and this is my function to calc xyz from lat lon and radius function calcPosFromLatLonRad(lat,lon,radius){ // Attempt1 var cosLat = Math.cos(lat * Math

Move a LatLng 5 meters towards another LatLng

倾然丶 夕夏残阳落幕 提交于 2019-12-03 13:48:08
What algorithm/formula can I use to calculate a LatLng point 5 meters closer to another LatLng point? I'm trying to write a function with 2 LatLng parameters and have it return a LatLng that is 5 meters from the first LatLng and in the direction of the second LatLng. Have a look at Android Map Utils library, specifically the SphericalUtil class. 1.) Call the method computeHeading to obtain your heading from first to second 2.) Call the method computeOffset to solve for the location 5 meters from your first point Hope this helps 来源: https://stackoverflow.com/questions/26594445/move-a-latlng-5

how to get satellite name or number when we are getting location through GPS in Android?

南楼画角 提交于 2019-12-03 13:25:33
问题 I am new in android, I am getting location through gps, I am also getting satellite number in our code but I want to get specific satellite name or number which is used to get the location. I have google so much but not getting proper solution regarding this. My Question is:- 1. It is possible to get a particular satellite name or number ? if yes please help me how to find it ? Thanks in advance 回答1: locationManager.getGpsStatus(null).getSatellites() (The caller may either pass in a GpsStatus

ocean latitude longitude point distance from shore

守給你的承諾、 提交于 2019-12-03 13:06:15
问题 I started a "free" open-sourced project to create a new data set for pH of the earth oceans. I started from the open data-set from NOAA and created a 2.45 millions rows data-set with those columns: colnames(NOAA_NODC_OSD_SUR_pH_7to9) [1] "Year" "Month" "Day" "Hour" "Lat" "Long" "Depth" "pH" Method document HERE. Data-set HERE. My goal now is to "qualify" each row (2.45m)... to do so, I need to calculate the distance from each point of Lat/Long to the nearest shore. So I am looking for a

HTML5 Geolocation implementation

与世无争的帅哥 提交于 2019-12-03 12:56:06
问题 I have a list of areas and lattitude/longitude which I'm asking the user to select their location when they hit my site. I'd like to have their location prefilled using HTML5's geolocation if possible, but I'm not exactly sure the best way to do that. There seems to be a lack of tutorials on the web, at least from what I can find. Has anyone done this? Do you know of a good tutorial/resource? update If I have coordinates of bunch of cities, how can I use javascript to determine the closest

Lookup telephone area code by latitude and longitude

强颜欢笑 提交于 2019-12-03 12:42:56
Looking for a way to get a list of telephone area codes for a given latitude and longitude (and if necessary a given intl. code.) Note, I'm not talking about international dialing prefixes but the area codes within them. For example, Denver Colorado is covered by the area codes 303 and 720. It's at 39.739 -104.985 and is in NANP 1. So given 39.739,-104.985,1 I'd like to get back [303,720]. Libraries, web services, DB's, or raw data that needs to be parsed into a DB, e.g., a web page of shape points, are all fine and the more global coverage the better, but just NANP 1 would be a great help.

Spatial Index in MySQL - ERROR - Cannot get geometry object from data you send to the GEOMETRY field

Deadly 提交于 2019-12-03 12:17:44
I am new to the whole 'spatial index' thing, but it seems to be the best solution for filtering based on latitude/longitude. So I added a column to my table: So I created a geometry field: ALTER TABLE `addresses` ADD `point` POINT NOT NULL And then I tried to add an index: ALTER TABLE `addresses` ADD SPATIAL INDEX ( `point` ) But I get an error: #1416 - Cannot get geometry object from data you send to the GEOMETRY field What am I doing wrong here? jisaacstone OK I found the solution: Can't create a spatial index if some of the column fields contain no data. After running UPDATE `addresses` SET

ZIP / Postal Code + Country to Geo Coordinates

亡梦爱人 提交于 2019-12-03 12:10:59
问题 What is the most complete, precise and reliable way to get the coordinates (latitude / longitude) of a given ZIP / Postal Code of a given country? I need to make a lot of requests, so a high API limit rate (maybe even absent) would be useful. GeoNames dumps would be cool, but it seems to have way too many duplicate coordinates (example) and it also seems that their database is missing some ZIP / postal codes for specific countries. Are there any other (reliable) alternatives? While I was