gps

Calculate X and Y position on a PNG Map from GPS Coordinate

拥有回忆 提交于 2019-12-06 09:37:08
I'm implementing a custom maps (image with size map_width and map_height) on an iPhone app and i try to show the current user position on this map (current_long and current_lat) I have 2 references points with a known GPS coordinates (ref1_long, ref1_lat, ref2_long and ref2_lat) and known X, Y positions in pixels (ref1_x, ref1_y, ref2_x and ref2_y) My question is: how to calculate the current_x and current_y according to these informations ? You need to know the projection of the map. There are hundreds of different map projection and many of them can have the important constants that can have

Determining if user is driving using gps

断了今生、忘了曾经 提交于 2019-12-06 09:33:26
Is there a way in Android to somehow use the GPS to determine if the user is driving (e.g. if the user is moving faster then say, 10 mph)? What would be even better is if there was an intent I could receive whenever the user is moving faster then 10 mph or under 10 mph, but I think I'm pushing my luck with that one. Any help would be appreciated. You probably want to set up some AsyncTask (background thread) with a call back function of your preference, which will be called when the speed is over 10 MPH. You can use the Location.GetSpeed() function. Also, you might want to take note of the

Transforming GPS coordinates for OpenLayers

自闭症网瘾萝莉.ら 提交于 2019-12-06 09:03:21
I am building a project in JavaScript that uses OpenLayers with an OpenStreetMap layer. I have the coordinates "48.3185005, 14.2853003" (the coordinated of Linz, Austria) which I get from either navigator.geolocation.getCurrentPosition() or the Google Maps Geocoding API. Now I want to show this point on the map. Which transformations are necessary for the map to display the correct location and how do I do these transformations with OpenLayers? At the moment, I am always getting some point east of Africa. This is because OpenStreetMap data is a projected coordinate system, known as Web

Get GPS data from Ar Drone 2.0

Deadly 提交于 2019-12-06 08:59:42
I need the real time GPS coordinates from the AR Drone 2.0 which has the flight recorder in it.And i couldn't find any method to get the values from GPS directly. Is there any way i could get the GPS data from the AR Drone Here is what's working for me: var arDrone = require('ar-drone'); var droneClient = arDrone.createClient(); droneClient.config('general:navdata_demo', 'FALSE'); // get back all data the copter can send droneClient.config('general:navdata_options', 777060865); // turn on GPS droneClient.on('navdata', function(navdata) { console.log(navdata.gps.latitude + ', ' + navdata.gps

How to compare 2 location positions

孤街醉人 提交于 2019-12-06 08:40:05
I have an App with a TextView that finds your location and when you move, the value in TextView changes. I want to know what can I do in order to register the first location and then look for the location 5 min after. For example: min 0 LAT 000000 LONG 000000 ( SAVE IT ) min 5 LAT 1111111 LONG 111111 if min0 == min 5 ... To sum up, I want to compare 2 strings (lat & long at the beginning) and lat & long after 5 minutes. Any suggestion will be appreciated. This Link should serve your purpose; Go through distanceTo or distanceBetween . You can create a Location object from a latitude and

Android: how to find total distance covered using GPS when continuously moving?

与世无争的帅哥 提交于 2019-12-06 08:34:06
问题 This is my code. Please tell me y it is not able to calculate the distance.. In this code res is a long variable which is supposed to store the total distance covered. This code is supposed to calculate distance based on GPS as soon as there is a change in the latitude and longitude.. String serviceString = Context.LOCATION_SERVICE; LocationManager locationManager; locationManager= (LocationManager)getSystemService(serviceString); String provider = LocationManager.GPS_PROVIDER; final Location

read NMEA sentences from GPS

匆匆过客 提交于 2019-12-06 08:02:21
问题 I have a Mio P550 device, which has a GPS included. I try to use SerialPort to get NMEA sentences, by simply use SerialPort.Read(). Data is returned in some weird encoding. GPS should return NMEA sentences in ASCII, but it doesn't. Here is my code for reading: dataLength = this.serialPort.Read(buffor, 0, Gps.BUFFOR_LENGTH); Debug.WriteLine("data length: " + dataLength); if (dataLength > 0) { for (int i = 0; i < dataLength; i++) { char c = Convert.ToChar(buffor[i]); if (c == '\r' || c == '\n')

Matching Location.getTime() milliseconds to NMEA sentences

偶尔善良 提交于 2019-12-06 07:57:26
I get GPS fix times with millisecond precision on my Nexus 7 (sometimes) as well as my Galaxy S3 (almost always). By this I mean the millis are not "000". To make sure this was not fake time resolution introduced by the Android system, I am also capturing the NMEA sentences. And I cannot seem to find where the millis are coming from! First, the Galaxy S3. The fix time is XX.07.55.318 (XX is hours, doesn't matter). You will see this sentence (see below for logs from both Galaxy and Nexus) $GPGGA,140755.3,3920.030827,N,07721.484989,W,1,07,1.5,165.6,M,-42.0,M,,*66 That explains the "3xx" in the

Can be located which floor we are via smart phone GPS?

最后都变了- 提交于 2019-12-06 07:55:17
问题 Is there a way that can decide which floor we are via smart phone? For example, i m in a building. floor 5; the native app in my smart phone can know i m on floor 5 and give me some advice about floor 5(navigation to floor 1) 回答1: With some newer Android phones (e.g., Samsung Galaxy S3), embedded barometric pressure sensors can be used to derive an accurate indoor altitude estimate, which could be transformed into floors (assuming you know which elevation the floor is located at). See this

Google Maps - Location keeps jumping between my real location and 0.6 miles away (Random place)

孤街醉人 提交于 2019-12-06 07:41:07
问题 I've got Google Maps v2 running on my app, using a service to get the users location. Problem is the location keeps changing. It shows my real location for a bit, then jumps to a random location that I've never been to before. I'm check GPS/Network lat/lng via the service and calling them in my maps class, where I then animate the camera to move to my location. I don't really know what's wrong, or where to start with this one. Does anyone know what sort of problem this is? It's baffling to me