JTmartins Active Member Licensed User Longtime User Jan 7, 2013 #1 Hello guys, Why am I getting values such as 7.1219963E-9 when using the DistanceTo function ? I've tryed so many ways, read all the forum posts I found and always get this values !!!! I have lats and longs for both points in a DB stored in format as this example : point 1 : Latitude : 51.827975 Longitude 10.7910733333333 Point 2 : Latitude : 51.8276666666667 Longitude : 10.7919216666667 I've tryed with this coordinates or converting them to minutes, always getting the same result... I'm getting nanometers ?????:sign0060: Help...:sign0163: Thanks
Hello guys, Why am I getting values such as 7.1219963E-9 when using the DistanceTo function ? I've tryed so many ways, read all the forum posts I found and always get this values !!!! I have lats and longs for both points in a DB stored in format as this example : point 1 : Latitude : 51.827975 Longitude 10.7910733333333 Point 2 : Latitude : 51.8276666666667 Longitude : 10.7919216666667 I've tryed with this coordinates or converting them to minutes, always getting the same result... I'm getting nanometers ?????:sign0060: Help...:sign0163: Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 8, 2013 #2 This code returns 67.xx: B4X: Dim l1, l2 As Location l1.Initialize2(51.827975, 10.7910733333333) l2.Initialize2(51.8276666666667, 10.7919216666667) Log(l1.DistanceTo(l2)) Upvote 0
This code returns 67.xx: B4X: Dim l1, l2 As Location l1.Initialize2(51.827975, 10.7910733333333) l2.Initialize2(51.8276666666667, 10.7919216666667) Log(l1.DistanceTo(l2))
JTmartins Active Member Licensed User Longtime User Jan 9, 2013 #3 Solved Thanks Erel, I had latitude and Longitude as double...Changed to String and it worked. I thought this would be automatic. Regards, Jose Upvote 0
Solved Thanks Erel, I had latitude and Longitude as double...Changed to String and it worked. I thought this would be automatic. Regards, Jose
Erel B4X founder Staff member Licensed User Longtime User Jan 10, 2013 #4 It is automatic. As you can see in my code the numbers are doubles. Upvote 0
JTmartins Active Member Licensed User Longtime User Jan 10, 2013 #5 I believe in you I believe in you, and I've read that B4A type casting is automatic, and never had problems before. Only with DistanceTo But the truth is that when I change to double...it gives me strange numbers, and when changed to strings works properly. Never mind for now. It works. If I have problems with this, I'll come back here. Thanks Upvote 0
I believe in you I believe in you, and I've read that B4A type casting is automatic, and never had problems before. Only with DistanceTo But the truth is that when I change to double...it gives me strange numbers, and when changed to strings works properly. Never mind for now. It works. If I have problems with this, I'll come back here. Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 10, 2013 #6 No type casting is needed if you use doubles as this method expects doubles. If you like you can post your code. The problem is somewhere else. Upvote 0
No type casting is needed if you use doubles as this method expects doubles. If you like you can post your code. The problem is somewhere else.