Merge pull request #3045 from Project-OSRM/fix/tilez-limit
Add max zoom limit of z12 to tile plugin parameters
This commit is contained in:
commit
45df2c991f
@ -64,7 +64,8 @@ struct TileParameters final
|
|||||||
// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#X_and_Y
|
// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#X_and_Y
|
||||||
const auto valid_x = x <= static_cast<unsigned>(std::pow(2., z)) - 1;
|
const auto valid_x = x <= static_cast<unsigned>(std::pow(2., z)) - 1;
|
||||||
const auto valid_y = y <= static_cast<unsigned>(std::pow(2., z)) - 1;
|
const auto valid_y = y <= static_cast<unsigned>(std::pow(2., z)) - 1;
|
||||||
const auto valid_z = z < 20;
|
// zoom limits are due to slippy map and server performance limits
|
||||||
|
const auto valid_z = z < 20 && z >= 12;
|
||||||
|
|
||||||
return valid_x && valid_y && valid_z;
|
return valid_x && valid_y && valid_z;
|
||||||
};
|
};
|
||||||
|
@ -372,8 +372,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If we're zooming into 16 or higher, include turn data. Why? Because turns make the map
|
// If we're zooming into 16 or higher, include turn data. Why? Because turns make the map
|
||||||
// really
|
// really cramped, so we don't bother including the data for tiles that span a large area.
|
||||||
// cramped, so we don't bother including the data for tiles that span a large area.
|
|
||||||
if (parameters.z >= MIN_ZOOM_FOR_TURNS)
|
if (parameters.z >= MIN_ZOOM_FOR_TURNS)
|
||||||
{
|
{
|
||||||
// Struct to hold info on all the EdgeBasedNodes that are visible in our tile
|
// Struct to hold info on all the EdgeBasedNodes that are visible in our tile
|
||||||
|
@ -383,11 +383,23 @@ BOOST_AUTO_TEST_CASE(valid_nearest_urls)
|
|||||||
CHECK_EQUAL_RANGE(reference_2.coordinates, result_2->coordinates);
|
CHECK_EQUAL_RANGE(reference_2.coordinates, result_2->coordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(valid_tile_urls)
|
BOOST_AUTO_TEST_CASE(invalid_tile_urls)
|
||||||
{
|
{
|
||||||
TileParameters reference_1{1, 2, 3};
|
TileParameters reference_1{1, 2, 3};
|
||||||
auto result_1 = parseParameters<TileParameters>("tile(1,2,3).mvt");
|
auto result_1 = parseParameters<TileParameters>("tile(1,2,3).mvt");
|
||||||
BOOST_CHECK(result_1);
|
BOOST_CHECK(result_1);
|
||||||
|
BOOST_CHECK(!result_1->IsValid());
|
||||||
|
BOOST_CHECK_EQUAL(reference_1.x, result_1->x);
|
||||||
|
BOOST_CHECK_EQUAL(reference_1.y, result_1->y);
|
||||||
|
BOOST_CHECK_EQUAL(reference_1.z, result_1->z);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(valid_tile_urls)
|
||||||
|
{
|
||||||
|
TileParameters reference_1{1, 2, 12};
|
||||||
|
auto result_1 = parseParameters<TileParameters>("tile(1,2,12).mvt");
|
||||||
|
BOOST_CHECK(result_1->IsValid());
|
||||||
|
BOOST_CHECK(result_1);
|
||||||
BOOST_CHECK_EQUAL(reference_1.x, result_1->x);
|
BOOST_CHECK_EQUAL(reference_1.x, result_1->x);
|
||||||
BOOST_CHECK_EQUAL(reference_1.y, result_1->y);
|
BOOST_CHECK_EQUAL(reference_1.y, result_1->y);
|
||||||
BOOST_CHECK_EQUAL(reference_1.z, result_1->z);
|
BOOST_CHECK_EQUAL(reference_1.z, result_1->z);
|
||||||
|
Loading…
Reference in New Issue
Block a user