Start a new topic

GPS Accuracy and double casting

GPS Accuracy and double casting

Hi there,

A very particular question on his way:

- Can I explicit use a double GPS accuracy instead of the cast into a float?
- Is there any trick to explicit avoid the conversion?



Hi Piervincenzo,

What platform are you developing on (Android, iOS) and do you use any SDK plugins (Phonegap, Titanium etc.), or do you use the native Android or iOS Wikitude SDK?

In case you are talking about our JavaScript onLocationChanged(...) function, remember that there is no explicit float or double type in JavaScript, JavaScript only has a Number type.



Hi Martin,

to answer to your question:

- android
- phonegap

The issue I'm figuring is this one: my model have a strange horizontal shake effect. If you open the solarsystem GEO example you will able to have a look to what I mean: the planets suddently move on horizontal line without a reason. I think that this behaviour si related to GPS positioning on the native part I've got a 16 decimal number while into js there is a kind of floor (ie. 38.888888888888888 --> 38.8888889).

Is there a way to avoid this?



If needed I have a video to show you the shake...

Hi Piervincenzo,

Some hints from my end:

1) Note that the locations used in the Solar System are RelativeLocations and therefore shown same distance and direction to the user, no matter if he/she is walking / receveives location updates, or not.

2) The float / number issue you mentioned does not make a real difference, you notice that rounding digits in current implementation does not have a noticable effect on the location (e.g. drag and drop crosshair on this website and check lat / lon value updates)

3) I guess your finding is related to the currently missing gyroscope support, which may cause compass/accelerometer value inaccuracy causing this slight shake effect. Gyroscope support is yet not scheduled and may not even affect all Android devices out there.

Kind regards,


I see the point but:

Do you think that this behaviour is related to Gyroscope lack of?


Please let me know,


Hi there!

Thanks for the video, which shows the compass inaccuracy quite well.
This behavior highly depends on your device's compass, its calibration status and interference of your surrounding.
Once gyroscope is supported and your device comes with the required hardware this "floating-issue" will no longer occur.

Kind regards,

Perfect this is the answer I was looking for (an official one!).

So do you think that a workaround exists to avoid this behaviour. I mean I tryied a new calibration but seems that even if I use another app to "test if the compass works" some little movement suddently appears.

Any advice or tricks?

Thanks again!


Hi again!

This sounds like an HW issue. We observed this on some (usually older) devices in the office - Seems as if this has something to do with the arrangement of Chips and Sensors on the device. That may e.g. cause GPS not to work properly when camera or WiFi is enabled.

Could you please test on different devices and let me know your findings.

Kind regards
Login or Signup to post a comment