heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
145 stars 191 forks source link

How to implement the map matching for fine-tune the inaccuracies GPS data. #358

Open ChenYuehNung opened 4 years ago

ChenYuehNung commented 4 years ago

Hi team,

In navigation, when we stop to wait for traffic lights, GPS sometimes jumps to the distance. We know this is an inaccurate GPS data. But we want to solve this issue.

I have read the map matching and custom data sources in the user guide(https://developer.here.com/documentation/android-premium/3.15/dev_guide/topics/map-matching.html), but I still don't understand.

my question is:

  1. If I want to enable map matching in navigation, just use PositioningManager.setMapMatchingEnabled(true), right?

  2. How to submit null to the positioning manager (steps 2 & 3 in the custom data source). Can you provide an example to implement this? I can't find LocationDataSource.onLocationUpdated().

  3. Can I also submit a real position to the positioning manager? (we want to update the incorrect location and fine-tune by another case)?

NazarKacharaba commented 4 years ago

Hi @ChenYuehNung

  1. That is correct 2-3 We will provide you an example how to do that.
ChenYuehNung commented 4 years ago

Hi @ChenYuehNung

  1. That is correct 2-3 We will provide you an example how to do that.

Thanks @NazarKacharaba I am waiting for your example to implement.

Merlin1stHere commented 4 years ago

@ChenYuehNung As you know, you must inherit your own data source class from the LocationDataSource class. When you should pass NULL to indicate that the current position is lost, you should call onLocationUpdated method from the base class. super.onLocationUpdated(PositioningManager.LocationMethod.GPS, null);

To send real position to the PositioningManager you should use the same way. Just call super.onLocationUpdated method somewhere inside your data source class. It can be on a timer or etc.