summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-09-11 04:57:57 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-09-11 05:53:40 (GMT)
commit4c0533d747f4569df8adfa455f08a6ce3fafb855 (patch)
tree8fc8c34fae414900d4ddef5fc5eee0eecadd0428
parentcc98be13cf2a13bd4ed16c8f37569f97cbe46e4d (diff)
Fix generated tile IDs for medium/high levels
-rw-r--r--tools/vectorosm-tilecreator/TileIterator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/vectorosm-tilecreator/TileIterator.cpp b/tools/vectorosm-tilecreator/TileIterator.cpp
index 0de09e6..1774b3c 100644
--- a/tools/vectorosm-tilecreator/TileIterator.cpp
+++ b/tools/vectorosm-tilecreator/TileIterator.cpp
@@ -10,6 +10,7 @@
#include "TileIterator.h"
#include "TileId.h"
+#include "VectorTileModel.h"
#include <QDebug>
@@ -46,12 +47,11 @@ TileIterator::TileIterator(const GeoDataLatLonBox &latLonBox, int zoomLevel)
{
qreal north, west, south, east;
latLonBox.boundaries(north, south, east, west);
- TileId const topLeft = TileId::fromCoordinates(GeoDataCoordinates(west, north), zoomLevel);
- TileId const bottomRight = TileId::fromCoordinates(GeoDataCoordinates(east, south), zoomLevel);
- m_bounds.setLeft(topLeft.x());
- m_bounds.setTop(topLeft.y());
- m_bounds.setRight(bottomRight.x());
- m_bounds.setBottom(bottomRight.y());
+ unsigned int N = pow(2, zoomLevel);
+ m_bounds.setLeft(TileId::lon2tileX(west, N));
+ m_bounds.setTop(TileId::lat2tileY(north, N));
+ m_bounds.setRight(TileId::lon2tileX(east, N));
+ m_bounds.setBottom(TileId::lat2tileY(south, N));
}
TileIterator::const_iterator TileIterator::begin() const