I am trying to create the navigation application with offline routing .i want to add the bearing value of GPS point so route will be calculated in the direction of the vehicle. i have sample code from android so could anybody have idea how to do it in QML
Map<String,Object> attributes = new HashMap<String,Object>();
attributes.put("CurbApproach", CurbApproach.Right.value); // set right side curb approach
if(item.GPSLocation!=null && item.GPSLocation.hasBearing())
{
attributes.put("Bearing", item.GPSLocation.getBearing());
attributes.put("BearingTol", 30); // bearing tolerance 30
}
StopGraphic stop = new StopGraphic(item.geometry,attributes);
Thanks
Haider
Solved! Go to Solution.
Going with what Alex suggested, you should be able to obtain the bearing through position source. Position Source is a QML type that will allow you to gather the current coordinate. From the coordinate, you can obtain the bearing. Please see the help from Qt regarding the coordinate QML type - coordinate QML Basic Type | Qt Positioning 5.5
real azimuth(coordinate other)
Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.
This is something that would be achieved from taking the position source (pure QML) and getting the position property from it which contains a direction property. The following documentation you may find helpful:
Hello Alexander,
Thanks a lot for your reply but i think you don't get the idea. i want to adjust the bearing value from GPS Signal to the stop attribute so route is always calculated in direction of vehicle is moving.
that functionality is available on Arcgis desktop but i am not sure it is available on Qt and other mobile platforms.
please check the bearing and bearing tolarance functionlity on arcmap desktop
What are Bearing and BearingTol fields?—Help | ArcGIS for Desktop
Going with what Alex suggested, you should be able to obtain the bearing through position source. Position Source is a QML type that will allow you to gather the current coordinate. From the coordinate, you can obtain the bearing. Please see the help from Qt regarding the coordinate QML type - coordinate QML Basic Type | Qt Positioning 5.5
real azimuth(coordinate other)
Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.