pre-commit run --show-diff-on-failure --color=always --all-files [skip ci]

This commit is contained in:
Artem Pavlenko 2024-02-26 14:48:49 +00:00
parent c067399041
commit 38193817de
4 changed files with 16 additions and 13 deletions

View file

@ -45,7 +45,8 @@ struct geometry_is_empty
{
for (auto const& ring : poly)
{
if (!ring.empty()) return false;
if (!ring.empty())
return false;
}
return true;
}
@ -56,7 +57,8 @@ struct geometry_is_empty
{
for (auto const& line : mline)
{
if (!line.empty()) return false;
if (!line.empty())
return false;
}
return true;
}
@ -65,7 +67,8 @@ struct geometry_is_empty
{
for (auto const& poly : mpoly)
{
if (!operator()(poly)) return false;
if (!operator()(poly))
return false;
}
return true;
}

View file

@ -64,10 +64,11 @@ struct create_linestring
{
mapnik::geometry::line_string<double> line;
std::size_t size = points.size();
//if (size < 2)
// if (size < 2)
//{
// throw std::runtime_error("RFC 7946: For type \"LineString\", the \"coordinates\" member is an array of two or more positions.");
//}
// throw std::runtime_error("RFC 7946: For type \"LineString\", the \"coordinates\" member is an array of
// two or more positions.");
// }
line.reserve(size);
for (auto&& pt : points)
{
@ -114,7 +115,7 @@ struct create_polygon
void operator()(ring const& points) const
{
//POLYGON EMPTY
// POLYGON EMPTY
geom_ = std::move(mapnik::geometry::polygon<double>{});
}
@ -182,7 +183,7 @@ struct create_multilinestring
void operator()(ring const& points) const
{
//MULTILINESTRING EMPTY
// MULTILINESTRING EMPTY
geom_ = std::move(mapnik::geometry::multi_line_string<double>{});
}
@ -231,7 +232,7 @@ struct create_multipolygon
void operator()(rings const& rngs) const
{
//MULTIPOLYGON
// MULTIPOLYGON
mapnik::geometry::multi_polygon<double> multi_poly;
mapnik::geometry::polygon<double> poly;
std::size_t num_rings = rngs.size();
@ -245,7 +246,7 @@ struct create_multipolygon
void operator()(ring const& points) const
{
//MULTIPOLYGON EMPTY
// MULTIPOLYGON EMPTY
geom_ = std::move(mapnik::geometry::multi_polygon<double>{});
}

View file

@ -145,7 +145,7 @@ TEST_CASE("geojson")
{
std::cerr << json << std::endl;
}
//REQUIRE(mapnik::geometry::is_empty(geom));
// REQUIRE(mapnik::geometry::is_empty(geom));
// round trip
std::string json_out;
CHECK(mapnik::util::to_geojson(json_out, geom));

View file

@ -20,7 +20,6 @@
*
*****************************************************************************/
#include "catch.hpp"
#include <mapnik/geometry/is_empty.hpp>