gps

How to convert GPS coordinates to decimal in Lua?

自古美人都是妖i 提交于 2019-12-02 05:50:54
I need to convert GPS coordinates from WGS84 to decimal using Lua. I am sure it's been done before, so I am looking for a hint to a code snippet. corrected question: Code to convert DMS (Degress Minutes Seconds) to DEG ((decimal) Degrees) in Lua? examples: Vienna: dms: 48°12'30" N 16°22'28" E or Zurich: dms: 47°21'7" N 8°30'37" E The difficulty I find is to get the numbers out of these strings. Especially how to handle the signs for degree (°) minutes (') and seconds ("). So that I would have for example a table coord{} per coordinate to deal with. coord {1} [48] coord {2} [12] coord {3} [30]

GpsStatus.Listener not firing on network status changes

帅比萌擦擦* 提交于 2019-12-02 04:54:11
I want my RTT app to be able to control when/whether we are receiving location updates, no matter from GPS or network. I can easily control GPS status with a GpsStatus.Listener but I cannot find the equivalent for network updates. For example, the event would fire if we enter an area with no network or wifi, or a timeout will occur like in the case covered by GpsStatus.GPS_EVENT_SATELLITE_STATUS Codes snippets here: mGPSReceiver = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE); mLocationListener = new LocationListener() { private Location mLastLocation; @Override public void

GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX

南笙酒味 提交于 2019-12-02 04:30:30
问题 I added a gps status listener to my location manager in order see when I get the first fix. When I receive the GPS_EVENT_FIRST_FIX I then loop through all the satellites, but why is none of them used in the fix? ( usedInFix() ). My log says 'false' for all satellites? final class GpsStatusListener implements GpsStatus.Listener { public void onGpsStatusChanged(int i) { if (i==GpsStatus.GPS_EVENT_FIRST_FIX) { Log.d(APP, "gpsx.fixed."); for (GpsSatellite sat:locationManager.getGpsStatus(null)

Calculating gps coordinate radius

左心房为你撑大大i 提交于 2019-12-02 04:04:59
问题 I have this coordinates: lat: 45.815005 lon: 15.978501 and i have mysql table with lat and lon coordinates stored as float what i need is to get all coordinate in 500 meters around me? so basicly my problem is to add X meters to my coordinate location Also: how can i separate coordinate 45.815005 (45 | 81 | 50 | 05 ???) so i can store them in mysql using indexes for quicker search? 回答1: MySQL supports a spatial extension (quoting) : MySQL supports spatial extensions to enable the generation,

Android : Service restarting automatically

烈酒焚心 提交于 2019-12-02 04:04:48
问题 I'm working with a service which saves GPS latlng's continiously But many times the service is getting restarted automatically, which results in data loss... so is there any way that we can restrict the service from restarting. or any idea to clear this issue. 回答1: You can create a new process for the service by mentioning it in the Manifest file as android:process=":newservice" Inside the service tag 回答2: You can do couple of things. 1) detach any UI life-cycle components, preferably switch

Android - Locations got from LocationClient doesn't support speed

别说谁变了你拦得住时间么 提交于 2019-12-02 03:41:55
I'm using the new Google LocationClient to retrieve geo locations. And I need to get speed for each point (location). What I'm doing now is: if (mLocationClient == null) { mLocationClient = new LocationClient(this, mLocationCallback, mLocationCallback); mLocationCallback.setLocationClient(mLocationClient); if (!(mLocationClient.isConnected() || mLocationClient.isConnecting())) { mLocationClient.connect(); } } Where mLocationCallback is an instance of public class LocationCallback implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener {} In the function, @Override public

Calculating gps coordinate radius

佐手、 提交于 2019-12-02 03:40:50
I have this coordinates: lat: 45.815005 lon: 15.978501 and i have mysql table with lat and lon coordinates stored as float what i need is to get all coordinate in 500 meters around me? so basicly my problem is to add X meters to my coordinate location Also: how can i separate coordinate 45.815005 (45 | 81 | 50 | 05 ???) so i can store them in mysql using indexes for quicker search? MySQL supports a spatial extension (quoting) : MySQL supports spatial extensions to enable the generation, storage, and analysis of geographic features. Using those, instead of storing coordinates your own way,

Android Location Manager Issue

旧街凉风 提交于 2019-12-02 03:17:40
From the following code, I get the current location. Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); criteria.setPowerRequirement(Criteria.POWER_LOW); String provider = locationManager.getBestProvider(criteria, true); GlobalLocation = locationManager.getLastKnownLocation(provider); locationManager.requestLocationUpdates(provider, 2000, 10, locationListener); After getting the location I draw the location overlays on Google map and from location provider I

Android - Locations got from LocationClient doesn't support speed

旧街凉风 提交于 2019-12-02 03:16:06
问题 I'm using the new Google LocationClient to retrieve geo locations. And I need to get speed for each point (location). What I'm doing now is: if (mLocationClient == null) { mLocationClient = new LocationClient(this, mLocationCallback, mLocationCallback); mLocationCallback.setLocationClient(mLocationClient); if (!(mLocationClient.isConnected() || mLocationClient.isConnecting())) { mLocationClient.connect(); } } Where mLocationCallback is an instance of public class LocationCallback implements

GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 02:41:42
I added a gps status listener to my location manager in order see when I get the first fix. When I receive the GPS_EVENT_FIRST_FIX I then loop through all the satellites, but why is none of them used in the fix? ( usedInFix() ). My log says 'false' for all satellites? final class GpsStatusListener implements GpsStatus.Listener { public void onGpsStatusChanged(int i) { if (i==GpsStatus.GPS_EVENT_FIRST_FIX) { Log.d(APP, "gpsx.fixed."); for (GpsSatellite sat:locationManager.getGpsStatus(null).getSatellites()) { Log.d(APP, "gpsx.GpsStatus.Sat.fixed: " + sat.usedInFix()); } } } } Log: gpsx.fixed.