Questions tagged [location]

Location is a specific position in physical space, e.g. a point on the surface of the Earth described using latitude and longitude coordinates. This tag should NOT be used for questions related to the position of a virtual element e.g. position of a pixel on a bitmap or position of a layout element on UI (use [position] tag in that cases).

The term location is used to identify a point or an area in physical space, such as on the Earths surface or within a room.

A relative location is a description of position relative to another known site — for example, "2 miles north of London".

An absolute location is designated using a specific pairing of latitude and longitude in a Cartesian coordinate grid — for example, a Spherical coordinate system or an ellipsoid-based system such as the World Geodetic System—or similar methods.

The term location generally implies a relatively high degree of certainty of position.

9647 questions
159
votes
4 answers

Making a Location object in Android with latitude and longitude values

I have a program in which latitude and longitude values of a location are stored in a database, which I download. I want to get the distance between these coordinates, and my current location. The Location class has a simple method to find the…
fonduman
  • 1,655
  • 3
  • 11
  • 11
153
votes
21 answers

How to mock location on device?

How can I mock my location on a physical device (Nexus One)? I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device.
Isaac Waller
  • 32,709
  • 29
  • 96
  • 107
138
votes
3 answers

Android Location Providers - GPS or Network Provider?

In my application I would like to determine the user's current location. I do however have a couple of questions in this regard: There are different Location Providers, which one is the most accurate? The GPS Provider or the Network Provider? In…
Noman
  • 4,049
  • 10
  • 38
  • 59
138
votes
13 answers

Turn on location services without navigating to settings page

Against the traditional approach of prompting user to go to the settings page and enable location services and come back again, I have noticed a simpler way of doing the same in some of the latest apps. Referring to below screenshot, it prompts a…
GAMA
  • 5,958
  • 14
  • 79
  • 126
106
votes
11 answers

Check if location services are enabled

I've been doing some research about CoreLocation. Recently, I encountered a problem that has been covered elsewhere, but in Objective C, and for iOS 8. I feel kinda silly asking this, but how can you check if location services are enabled using…
Brendan Chang
  • 1,338
  • 2
  • 9
  • 10
104
votes
6 answers

How is location accuracy measured in Android?

Does anyone know the proper interpretation of the accuracy measurements returned by getAccuracy()? For instance, are they calculated as: Circular Error Probability (meaning, if i understand correctly, radius of a 50% confidence circle)? Radius of…
John R.B. Palmer
  • 2,082
  • 3
  • 17
  • 23
101
votes
9 answers

javascript window location href without hash?

I have: var uri = window.location.href; That provides http://example.com/something#hash What's the best and easiest way to get the entire path without the #hash? uri = http://example.com/something#hash nohash = http://example.com/something I…
matt
  • 42,713
  • 103
  • 264
  • 397
97
votes
10 answers

Algorithm to find all Latitude Longitude locations within a certain distance from a given Lat Lng location

Given a database of places with Latitude + Longitude locations, such as 40.8120390, -73.4889650, how would I find all locations within a given distance of a specific location? It doesn't seem very efficient to select all locations from the DB and…
Val Schuman
  • 1,798
  • 2
  • 18
  • 23
93
votes
9 answers

getLastKnownLocation returns null

I've read some questions about this, but I didn't quite find an answer that I needed. So, the case is that I have my map set up, and I want to grab my current gps location. I have checked that my variables is not NULL but yet my result…
Aleksander Fimreite
  • 1,439
  • 2
  • 18
  • 31
91
votes
4 answers

Where are include files stored - Ubuntu Linux, GCC

So, when we do the following: #include versus #include "myFile.h" the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive. It just utilizes the files with no interaction from me. I…
Frank V
  • 25,141
  • 34
  • 106
  • 144
87
votes
9 answers

window.location versus just location

Across the web, I see a vast number of JavaScript programmers writing window.location instead of just location. I was curious if anyone could offer an explanation as to why. window is the global object, and therefore it is unnecessary to include --…
Reid
  • 18,959
  • 5
  • 37
  • 37
86
votes
7 answers

jquery: change the URL address without redirecting?

Possible Duplicate: Modify Address Bar URL in AJAX App to Match Current State How can I change the URL address without redirecting the page? For instance, when I click on this link below:
Run
  • 54,938
  • 169
  • 450
  • 748
86
votes
6 answers

Redirect using AngularJS

I'm trying to redirect to another route using: $location.path("/route"); But for some reason it is not working. I did an auto-complete widget using jQuery-UI and I'm calling a function from the scope once the user selects an option. I debugged it…
Tomarto
  • 2,755
  • 6
  • 27
  • 37
85
votes
4 answers

Difference between LocationRequest setInterval (long millis) and LocationRequest setFastestInterval (long millis)

I am writing my own background location updates for interval of every 5 minutes in android. I would like to know the difference between setInterval and setFastestInterval When I setInterval to 5 mins and setFastestInterval to 2 mins. The location…
TheDevMan
  • 5,914
  • 12
  • 74
  • 144
84
votes
8 answers

Calculating distance between two geographic locations

please shed some light on this situation Right now i have two array having latitude and longitude of nearby places and also have the user location latiude and longiude now i want to calculate the distance between user location and nearby places and…
Sunny
  • 14,522
  • 15
  • 84
  • 129