distance

Measure distance to iBeacon from Android device

痞子三分冷 提交于 2019-11-30 15:17:56
I am working on an app that has to measure the distance to an iBeacon. When a user is within a distance (1 meter) the user should be notified. It is working fine on iOS but on Android I get various results. I am using the Estimote Android SDK ( https://github.com/Estimote/Android-SDK ) and Android 4.3. Below is measurement from a Nexus 4 and a Nexus 5. The iBeacon is placed one meter away from the phone (the measurements are consistent with more samples): Nexus 4: 08-25 11:39:04.788: : Major: 27485 Accuracy: 0.36351308115918884 Power: -74 Rssi: -67 08-25 11:39:05.880: : Major: 27485 Accuracy:

How to calculate distance between multiple points in SQL Server?

早过忘川 提交于 2019-11-30 13:44:52
I have table with data from GPS, e.g.: Latitude , Longitude , Time , UserId How to aggregate total distance in specified time frame summing all distances by all points (ordered by time) and group data by user? Thanks If you are using SQL Server, you might be interested in using the geography data type so you can request the database using the dedicated method and geographical index. The geography data type is available since SQL Server 2008, you can more information right here: http://msdn.microsoft.com/en-us/library/cc280766.aspx Once you've got the data into the geography column, you will be

Physical distance between two places

寵の児 提交于 2019-11-30 13:07:18
I need to measure the physical distance between two places whose names are provided as strings. Since sometimes the names are written slightly differently, I was looking for a library that could help me measure the difference and then combine it with a measure of the latitude and longitude to select the correct matches. Preferred languages: Java or PHP. Any suggestions? Have a look at the Levenshtein distance . This is a way of measuring how different two strings are from one another. Hopefully I understood your question correctly; using "distance" in the same sentence as "latitude and

Android : Location.distanceTo not working correctly?

不想你离开。 提交于 2019-11-30 11:44:15
I am having an issue calculating distance using the Location.distanceTo method. private class MyLocationOverlay1 extends MyLocationOverlay { @Override public void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) super.drawMyLocation(canvas,mapView,lastFix,myLocation,when); Location bLocation = new Location("reverseGeocoded"); bLocation.setLatitude(FindList.gpslat); // Value = 3.294391E7 bLocation.setLongitude(FindList.gpslong); // Value = -9.6564615E7 Location aLocation = new Location("reverseGeocoded"); aLocation.setLatitude(myLocation

How to get speed in android app using Location or accelerometer or some other way

丶灬走出姿态 提交于 2019-11-30 11:41:19
问题 I am working on app and try to get the speed and distance travelled by the user. I have used Google Play services location class to get the speed but it always returns me 0.0 value and not at all reliable. I wan accurate speed and distance travelled at real time. I have installed GPS Speedometer app on my device and its so perfect that even if i am walking then it gives me the speed. I want to get the same thing. I am confused in how to get speed, using location or using accelerometer or is

Large distance matrix in clustering

一曲冷凌霜 提交于 2019-11-30 10:08:55
I am running R 3.2.3 on a machine with 16 GB RAM. I have a large matrix of 3,00,000 rows x 12 columns. I wanna use a hierarchical clustering algorithm in R, so before I do that, I am trying to create a distance matrix. Since data is of mixed type, I use different matrices for different type. I get an error about memory allocation: df <- as.data.frame(matrix(rnorm(36*10^5), nrow = 3*10^5)) d1=as.dist(distm(df[,c(1:2)])/10^5) d2=dist(df[,c(3:8)], method = "euclidean") d3= hamming.distance(df[,c(9:12)]%>%as.matrix(.))%>%as.dist(.) I get the following error > d1=as.dist(distm(df1[,c(1:2)])/10^5)

Calculate distance between two vectors of different length

为君一笑 提交于 2019-11-30 08:05:07
问题 There are different methods to calculate distance between two vectors of the same length: Euclidean, Manhattan, Hamming ... I'm wondering about any method that would calculate distance between vectors of different length. 回答1: The Euclidean distance formula finds the distance between any two points in Euclidean space. A point in Euclidean space is also called a Euclidean vector. You can use the Euclidean distance formula to calculate the distance between vectors of two different lengths. For

KNN algo in matlab

不问归期 提交于 2019-11-30 07:46:06
I am working on thumb recognition system. I need to implement KNN algorithm to classify my images. according to this , it has only 2 measurements, through which it is calculating the distance to find the nearest neighbour but in my case I have 400 images of 25 X 42, in which 200 are for training and 200 for testing. I am searching for few hours but I am not finding the way to find the distance between the points. EDIT: I have reshaped 1st 200 images in to 1 X 1050 and stored them in a matrix trainingData of 200 X 1050. similarly I made testingData . Here is an illustration code for k-nearest

How can I extract the distance from Google Directions API via Excel web query?

亡梦爱人 提交于 2019-11-30 07:38:55
I have a long list of origins and destinations in Excel, using webquery I can fill in the cities and postal code to give a webquery like: http://maps.googleapis.com/maps/api/directions/xml?origin=Scoresby&destination=Melborne&sensor=false This returns me a long XML file, but all I need is just the distance. Is there a way to extract only the distance value? Or should I just run a macro script to extract distance one by one? (Since the format remains roughly the same each time I ask the server) The short answer is XPath - well worth learning if you are going to work with any kind of XML In the

How to calculate distance from user location to annotation when user moves

丶灬走出姿态 提交于 2019-11-30 07:24:34
I have an user location (blue dot) and annotations on mapView . When annotation is selected, I setting text to distLabel - "Distance to point %4.0f m.". How can I update that text label when user moves? didSelectAnnotationView: - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { CLLocation *pinLocation = [[CLLocation alloc] initWithLatitude: [(MyAnnotation*)[view annotation] coordinate].latitude longitude: [(MyAnnotation*)[view annotation] coordinate].longitude]; CLLocation *userLocation = [[CLLocation alloc] initWithLatitude: self.mapView.userLocation