pre-commit run --all-files

This commit is contained in:
Artem Pavlenko 2022-11-04 09:46:00 +00:00
parent bd018ef5ab
commit 5522cdd201
2 changed files with 37 additions and 18 deletions

View file

@ -62,7 +62,6 @@ struct spatially_equal_visitor
result_type operator()(mapnik::geometry::multi_line_string<double> const& lhs, result_type operator()(mapnik::geometry::multi_line_string<double> const& lhs,
mapnik::geometry::multi_line_string<double> const& rhs) const mapnik::geometry::multi_line_string<double> const& rhs) const
{ {
std::size_t size0 = lhs.size(); std::size_t size0 = lhs.size();
std::size_t size1 = rhs.size(); std::size_t size1 = rhs.size();
if (size0 != size1) if (size0 != size1)

View file

@ -8,7 +8,6 @@
#include <mapnik/vertex_adapters.hpp> #include <mapnik/vertex_adapters.hpp>
#include <mapnik/util/geometry_to_wkt.hpp> #include <mapnik/util/geometry_to_wkt.hpp>
// stl // stl
#include <stdexcept> #include <stdexcept>
@ -83,10 +82,21 @@ TEST_CASE("converters")
"douglas-peucker", "douglas-peucker",
std::string("LINESTRING(0 0,0 -10,-5 7,4 6)")); std::string("LINESTRING(0 0,0 -10,-5 7,4 6)"));
simplify(std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1425502300262 48.3706623938922,19.1425006091595 48.3706410120998,19.1425113379955 48.3706784302306,19.1424550116062 48.3706632848,19.1424348950386 48.3707069392642,19.1423343122005 48.3706632848,19.1422645747662 48.3706677393389,19.1411232948303 48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 48.3705055938728,19.1365367174149 48.3702775202553,19.1362524032593 48.3704022481414,19.1361290216446 48.3702917748863,19.1359841823578 48.3703594843292,19.1358715295792 48.3702953385434,19.1357481479645 48.3703844298907,19.1356247663498 48.3703452297171,19.1356556117535 48.3704075936154,19.1355912387371 48.3704102663522,19.1355885565281 48.3704432300945)"), simplify(
std::string(
"LINESTRING(19.1425676643848 48.3706356666503,19.1425502300262 48.3706623938922,19.1425006091595 "
"48.3706410120998,19.1425113379955 48.3706784302306,19.1424550116062 48.3706632848,19.1424348950386 "
"48.3707069392642,19.1423343122005 48.3706632848,19.1422645747662 48.3706677393389,19.1411232948303 "
"48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 "
"48.3705055938728,19.1365367174149 48.3702775202553,19.1362524032593 48.3704022481414,19.1361290216446 "
"48.3702917748863,19.1359841823578 48.3703594843292,19.1358715295792 48.3702953385434,19.1357481479645 "
"48.3703844298907,19.1356247663498 48.3703452297171,19.1356556117535 48.3704075936154,19.1355912387371 "
"48.3704102663522,19.1355885565281 48.3704432300945)"),
0.0001, 0.0001,
"douglas-peucker", "douglas-peucker",
std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1411232948303 48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1365367174149 48.3702775202553,19.1355885565281 48.3704432300945)")); std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1411232948303 48.3712040629718,19.1395568847656 "
"48.3707336664687,19.1382908821106 48.3711042822585,19.1365367174149 "
"48.3702775202553,19.1355885565281 48.3704432300945)"));
} }
SECTION("simplify-radial-distance") SECTION("simplify-radial-distance")
{ {
@ -120,10 +130,20 @@ TEST_CASE("converters")
"radial-distance", "radial-distance",
std::string("LINESTRING(0 0,0 -10,0 0,-5 7,4 6)")); std::string("LINESTRING(0 0,0 -10,0 0,-5 7,4 6)"));
simplify(std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1425502300262 48.3706623938922,19.1425006091595 48.3706410120998,19.1425113379955 48.3706784302306,19.1424550116062 48.3706632848,19.1424348950386 48.3707069392642,19.1423343122005 48.3706632848,19.1422645747662 48.3706677393389,19.1411232948303 48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 48.3705055938728,19.1365367174149 48.3702775202553,19.1362524032593 48.3704022481414,19.1361290216446 48.3702917748863,19.1359841823578 48.3703594843292,19.1358715295792 48.3702953385434,19.1357481479645 48.3703844298907,19.1356247663498 48.3703452297171,19.1356556117535 48.3704075936154,19.1355912387371 48.3704102663522,19.1355885565281 48.3704432300945)"), simplify(
std::string(
"LINESTRING(19.1425676643848 48.3706356666503,19.1425502300262 48.3706623938922,19.1425006091595 "
"48.3706410120998,19.1425113379955 48.3706784302306,19.1424550116062 48.3706632848,19.1424348950386 "
"48.3707069392642,19.1423343122005 48.3706632848,19.1422645747662 48.3706677393389,19.1411232948303 "
"48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 "
"48.3705055938728,19.1365367174149 48.3702775202553,19.1362524032593 48.3704022481414,19.1361290216446 "
"48.3702917748863,19.1359841823578 48.3703594843292,19.1358715295792 48.3702953385434,19.1357481479645 "
"48.3703844298907,19.1356247663498 48.3703452297171,19.1356556117535 48.3704075936154,19.1355912387371 "
"48.3704102663522,19.1355885565281 48.3704432300945)"),
0.000001, 0.000001,
"radial-distance", "radial-distance",
std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1411232948303 48.3712040629718,19.1395568847656 48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 48.3705055938728,19.1358715295792 48.3702953385434,19.1355885565281 48.3704432300945)")); std::string("LINESTRING(19.1425676643848 48.3706356666503,19.1411232948303 48.3712040629718,19.1395568847656 "
"48.3707336664687,19.1382908821106 48.3711042822585,19.1368532180786 "
"48.3705055938728,19.1358715295792 48.3702953385434,19.1355885565281 48.3704432300945)"));
} }
} }