diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-04-06 02:06:30 +0300 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-04-06 15:00:51 +0000 |
commit | 30f549fce76ec7d62234f618decce38d3ef1c475 (patch) | |
tree | 287b7efdaa8446e2140fa5bb8fc1f4050e3571ad | |
parent | 0ffb89591a9e2463b36948cdd5e2948de72e14c4 (diff) | |
download | qtlocation-30f549fce76ec7d62234f618decce38d3ef1c475.tar.gz |
Request 6-digit precision from OSRM geometries
Having an additional digit provides extra detail and can return more
accurate results along a path e.g. at the equator, six digits gives 10cm
of precision, while five digits yields about a meter.
Change-Id: Iec93ac77edbc0b355edee6e4184f1f8f8002e98a
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | src/location/maps/qgeorouteparserosrmv5.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/location/maps/qgeorouteparserosrmv5.cpp b/src/location/maps/qgeorouteparserosrmv5.cpp index d2699689..2167a4e8 100644 --- a/src/location/maps/qgeorouteparserosrmv5.cpp +++ b/src/location/maps/qgeorouteparserosrmv5.cpp @@ -76,9 +76,9 @@ static QList<QGeoCoordinate> decodePolyline(const QString &polylineString) int diff = (value & 1) ? ~(value >> 1) : (value >> 1); if (parsingLatitude) { - coord.setLatitude(coord.latitude() + (double)diff/1e5); + coord.setLatitude(coord.latitude() + (double)diff/1e6); } else { - coord.setLongitude(coord.longitude() + (double)diff/1e5); + coord.setLongitude(coord.longitude() + (double)diff/1e6); path.append(coord); } @@ -998,7 +998,7 @@ QUrl QGeoRouteParserOsrmV5Private::requestUrl(const QGeoRouteRequest &request, c QUrlQuery query; query.addQueryItem(QStringLiteral("overview"), QStringLiteral("full")); query.addQueryItem(QStringLiteral("steps"), QStringLiteral("true")); - query.addQueryItem(QStringLiteral("geometries"), QStringLiteral("polyline")); + query.addQueryItem(QStringLiteral("geometries"), QStringLiteral("polyline6")); query.addQueryItem(QStringLiteral("alternatives"), QStringLiteral("true")); query.addQueryItem(QStringLiteral("bearings"), bearings); if (!m_accessToken.isEmpty()) |