gps

R - How to convert latitude and longitude coordinates into an address/ human readable location?

安稳与你 提交于 2019-12-03 12:00:35
问题 How can I convert latitude and longitude coordinates into an address/ human readable location in R? For instance I have these data below: humandate lat lon 09/10/2014 13:41 41.83174254 -75.87998774 09/10/2014 13:53 41.83189873 -75.87994957 I want find out what the address/ location is for latitude 41.83174254, longitude -75.87998774. Is it possible with R? or with something else? 回答1: Use the revgeocode function from the ggmap package. Using your data.frame df : revgeocode(c(df$lon[1], df$lat

Foreground service not receiving location updates in Android 7.0+ when screen is off

断了今生、忘了曾经 提交于 2019-12-03 11:53:41
问题 I am trying to create an Android application that continuously logs device location data in realtime while the device screen is off. My code works correctly with Android 6.0 and earlier but it seems that Android 7.0+ breaks my app. I have implemented an Android foreground service that uses a wakelock and subscribes to the Google FusedLocation API. Once the screen is turned off the onLocationChanged callback is never triggered. Has anyone seen a solution to this problem? I have tried disabling

how to create maps which detect automatic location in React-Native

北城余情 提交于 2019-12-03 11:40:39
问题 I have created maps in react-native referring to https://github.com/lelandrichardson/react-native-maps map is created but i want to detect automatic location using gps. Here is the code which renders map with static latitude and longitude. Here's my updated code. But it still not rendering perfect location getInitialState() { return { initialPosition: 'unknown', lastPosition: 'unknown', }; }, componentDidMount() { navigator.geolocation.getCurrentPosition( (position) => { var initialPosition =

getting the highest GPS update rate from the GPS Hardware in my Android

拜拜、爱过 提交于 2019-12-03 11:27:10
I got to program Android from other platforms I used with GPS . on the other platfroms I had access to the GPS HW (I had a low level GPS driver) and by that I could get GPS updates 5 times per second and even more Now I work with Samsung Galaxy S2 (which it is clear to me that its GPS is very strong and can supply several updates per second Currently when I set the GPS provider to supply updates in minimum distance and minimum time like this: mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener ); I get 1 update per second (or 800ms as smallest gap between two

How to stop location manager?

最后都变了- 提交于 2019-12-03 10:24:47
Don't know why, but sometimes LocationManager is still working also after closing application. I call startGPS() in onCreate-Methode in one Activity (only one, let me call it StartActivity). protected void startGPS(){ try { lmanager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); lmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this); lmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); } catch(Exception e) { e.printStackTrace(); } } And if this activity will be destroyed (so, when application will be closed), I call endGPS() public

Set a mock GPS location on an Android device

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on automating some device/server testing we do on various android devices. I need a way to set a specific GPS lat/long on an actual Android device that is usable within a NUnit testing framework. Any help on this will be appreciated. 回答1: You need to set Allow mock locations true under Developer settings . After that you can write some small utility app which will set mock location on receiving some custom event. You can then set location using adb shell command e.g $ adb shell am start -a android.intent.action.SET_CUSTOM_MOCK

Android: detect when GPS is turned on/off (or when no app is using it anymore)

佐手、 提交于 2019-12-03 10:18:02
I'm on Android 2.3.7 and I'm trying to write a BroadcastReceiver that will get called when the user turns GPS on/off (ie: by tapping on the "use GPS satellites" in the options. What I've done so far is this: 1) Created the following broadcastReceiver: public class GPSStatusBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context arg0, Intent arg1) { Toast.makeText(arg0, "Broadcast received!", Toast.LENGTH_SHORT).show(); } } 2)Added this to the android manifest, inside the tags: <receiver android:name=".GPSStatusBroadcastReceiver"> <intent-filter> <action android

calculating a gps coordinate given a point, bearing and distance

烈酒焚心 提交于 2019-12-03 10:17:50
问题 I have a problem which draws my back in some project for some time now. Im basically looking to trap a polygon using x,y points drawn by some script ive written. lat1,lon1 are the center gps cords of the polygon and im looking for its surrounding polygon. here is a part of my code in python: def getcords(lat1,lon1,dr,bearing): lat2=asin(sin(lat1)*cos(dr)+cos(lat1)*sin(dr)*cos(bearing)) lon2=lon1+atan2(sin(bearing)*sin(dr)*cos(lat1),cos(dr)-sin(lat1)*sin(lat2)) return [lat2,lon2] my input goes

How to use a Kalman Filter to predict gps positions in between meassurements

假如想象 提交于 2019-12-03 10:03:43
问题 I have studied the OpenCV Kalman filter implementation and done some basic mouse pointer simulations and understand the basic. I seem to miss a few key points for using it in my application and was hoping someone here can provide a little example. Using a simple model with velocity and position: KF.statePre.at<float>(0) = mouse_info.x; KF.statePre.at<float>(1) = mouse_info.y; KF.statePre.at<float>(2) = 0; KF.statePre.at<float>(3) = 0; KF.transitionMatrix = (Mat_<float>(4, 4) << 1, 0, 1, 0, 0,

how to keep application running in background? keep collecting data?

我的未来我决定 提交于 2019-12-03 09:53:40
问题 UPDATED AT BOTTOM I have written an application that logs the users position, current speed, average speed and top speed. I would like to know how to make the application do the following things: prevent the screen from turning off while it is open on the screen if the user opens another app or returns to the home screen, gets a call etc, the app should keep collecting data (or would it be better to just write all data to a database everytime the location is updated? and maybe have a button