Missing Speed in Location info. How to calculate this?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Missing Speed in Location info. How to calculate this?
Hi,
I am missing the speed attribute in the LOcation Info (iOS iPhone). So I did a calculation for the speed (remember the old Long/Lat, calc the distance and device by the time between the old and new coordinates). But this seems to be very inaccurate.
Anyone a better solution?
I am missing the speed attribute in the LOcation Info (iOS iPhone). So I did a calculation for the speed (remember the old Long/Lat, calc the distance and device by the time between the old and new coordinates). But this seems to be very inaccurate.
Anyone a better solution?
Re: Missing Speed in Location info. How to calculate this?
Hi...
Why do you think it is inaccurate ? Is the calculation determining the speed, calculating the distance 'as the crow flies' instead of doing it from point A to B using the distance you would have covered on the road, as it were ?
Dixie
Why do you think it is inaccurate ? Is the calculation determining the speed, calculating the distance 'as the crow flies' instead of doing it from point A to B using the distance you would have covered on the road, as it were ?
Dixie
Re: Missing Speed in Location info. How to calculate this?
Hi,
Yes, that is the reason. It calculates from a point A to B in a straight line. this won't work if there is a curve in the road. Unless you get updates very quickly. But sometimes it takes 3 seconds before I get a location message again.
Yes, that is the reason. It calculates from a point A to B in a straight line. this won't work if there is a curve in the road. Unless you get updates very quickly. But sometimes it takes 3 seconds before I get a location message again.
Re: Missing Speed in Location info. How to calculate this?
Hi..
I have attached a stack that might point you in a direction to sort out your problem. I used this when I was first trying to find out how to get liveCode to play nicely with 'google maps.
Put your 'start' point into fld "start" and your destination into fld "stop"… Clicking the button 'locate' will calculate the distance between the two points, not in a straight line but the distance on the road.
So, for example, if you entered 'Wells,UK' into fld "start" and 'Shepton Mallet,UK' into fld "stop" it will return the distance between the two towns. You do not have to use the names of the towns as they could be substituted for latitude and longitude coordinates… I think that you should be able to adapt the script in the 'locate' button to use the 'old coordinate', 'new coordinate' routine to calculate what the distance is between two points on the road rather than in the straight line.
I'm sorry, but I don't have the time to sit down and script it for you at the moment, but it might give you some ideas...
be well
Dixie
I have attached a stack that might point you in a direction to sort out your problem. I used this when I was first trying to find out how to get liveCode to play nicely with 'google maps.
Put your 'start' point into fld "start" and your destination into fld "stop"… Clicking the button 'locate' will calculate the distance between the two points, not in a straight line but the distance on the road.
So, for example, if you entered 'Wells,UK' into fld "start" and 'Shepton Mallet,UK' into fld "stop" it will return the distance between the two towns. You do not have to use the names of the towns as they could be substituted for latitude and longitude coordinates… I think that you should be able to adapt the script in the 'locate' button to use the 'old coordinate', 'new coordinate' routine to calculate what the distance is between two points on the road rather than in the straight line.
I'm sorry, but I don't have the time to sit down and script it for you at the moment, but it might give you some ideas...
be well
Dixie
- Attachments
-
- latlong.livecode.zip
- (1.88 KiB) Downloaded 259 times
Re: Missing Speed in Location info. How to calculate this?
Thanks, I will take a look to it.
No problem.
No problem.
Re: Missing Speed in Location info. How to calculate this?
Hi,
Did was also to slow. I am conintues displaying the speed. I am wondering why did LC not add this to the location info. It is already a while to this object.
Did was also to slow. I am conintues displaying the speed. I am wondering why did LC not add this to the location info. It is already a while to this object.
Re: Missing Speed in Location info. How to calculate this?
Hi...
How quick do you want it to be ?... that routine takes between 91 - 107 millisecs to complete
be well
Dixie
How quick do you want it to be ?... that routine takes between 91 - 107 millisecs to complete
be well
Dixie
Re: Missing Speed in Location info. How to calculate this?
Hi,
Well I guess it is the speed. I am driving on a highway (120KM/H) and it is going from 90-140.
So I really need to have the speed property on LCLOcation info. Which is unfortunatly not implemented in LC
Well I guess it is the speed. I am driving on a highway (120KM/H) and it is going from 90-140.
So I really need to have the speed property on LCLOcation info. Which is unfortunatly not implemented in LC

Re: Missing Speed in Location info. How to calculate this?
Would you like to post your script ?
be well
Dixie
be well
Dixie