Languages

Menu
Sites
Language
Return Type of Tizen.Location.GetDistanceTo method

Appologies if it's not the right question to ask here but I can't see any description avaialble about the unit of returned distance  for the GetDistanceBetween and the GetDistanceTo methods availabe in Tizen.Location class.

 

I'm finding the distance (in meters) between two locations, I found GetDistanceTo method in the Tizen.Location calss.

 

should this method do the job for me?

 

Since there's no description about the unit of the distacne measured by the method so I'm looking for the guidance here.

Responses

5 Replies
Tizen .NET

Sorry for the inconvenience caused by the missing unit of distance.

You can use GetDistanceBetween(). It's meters. (In native api spec, it's mentioned.)

We'll improve the description of Tizen location C# API. Thanks.

 

Itban Saeed

Thank you so much for the response. It helped a lot :) 

Itban Saeed

Can you please check the functionality of this method. Because I doubt that it gives distance between two points in meters . I have the following code:

 

                //Get Location
                currentLocation = e.Location;

                //If current location is at least 5 meters away form previously saved location
                double distance = Location.GetDistanceBetween(previouslySavedLocation.Latitude, previouslySavedLocation.Longitude, currentLocation.Latitude, currentLocation.Longitude);
                if (distance > 5)
                {
                    //Save Information to Database
                    SaveLocationInformation();
                    previouslySavedLocation = currentLocation;
                }

                //Update View
                locationValue.TextColor = Color.YellowGreen;
                locationValue.Text = distance.ToString() + " - " + locationDataRowsCount.ToString() + "\nLatitude : " + currentLocation.Latitude + "\nLongitude : " + currentLocation.Longitude;

 

I'm checking the functionality in my room but the output of the code shows that the distance measured between two very close points is more than five meters

I will be thankful if you please check this.

Randeep Singh

If we start gps tracking without moving position, then also we can see the gps jumping slightly in most od the devices. It can show jumping even 5ms without any movement.  So this is  normal behavior of gps due to limitation of gps hardware performance.

Due to gps hardware API is giving wrong output.

 

Itban Saeed

Should it be reported as a bug so the Tizen Officials may check this behaviour ?