mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[util] Fix normalize spheroidal for nan coordinates.
Make sure that assertion doesn't fail for nan longitude. Make sure that a box containing nan longitude is not considered to be a band.
This commit is contained in:
parent
6099339544
commit
36a4275d39
@ -1,6 +1,6 @@
|
|||||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||||
|
|
||||||
// Copyright (c) 2015-2017, Oracle and/or its affiliates.
|
// Copyright (c) 2015-2022, Oracle and/or its affiliates.
|
||||||
|
|
||||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||||
@ -37,8 +37,8 @@ private:
|
|||||||
static inline bool is_band(CoordinateType const& longitude1,
|
static inline bool is_band(CoordinateType const& longitude1,
|
||||||
CoordinateType const& longitude2)
|
CoordinateType const& longitude2)
|
||||||
{
|
{
|
||||||
return ! math::smaller(math::abs(longitude1 - longitude2),
|
return math::larger_or_equals(math::abs(longitude1 - longitude2),
|
||||||
constants::period());
|
constants::period());
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -91,8 +91,7 @@ public:
|
|||||||
|
|
||||||
BOOST_GEOMETRY_ASSERT(! math::larger(longitude1, longitude2));
|
BOOST_GEOMETRY_ASSERT(! math::larger(longitude1, longitude2));
|
||||||
BOOST_GEOMETRY_ASSERT(! math::smaller(longitude1, constants::min_longitude()));
|
BOOST_GEOMETRY_ASSERT(! math::smaller(longitude1, constants::min_longitude()));
|
||||||
BOOST_GEOMETRY_ASSERT
|
BOOST_GEOMETRY_ASSERT(! math::larger(longitude2 - longitude1, constants::period()));
|
||||||
(! math::larger(longitude2 - longitude1, constants::period()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void apply(CoordinateType& longitude1,
|
static inline void apply(CoordinateType& longitude1,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||||
|
|
||||||
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
|
// Copyright (c) 2015-2022, Oracle and/or its affiliates.
|
||||||
|
|
||||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||||
@ -308,7 +308,7 @@ public:
|
|||||||
BOOST_GEOMETRY_ASSERT(! math::larger(latitude, constants::max_latitude()));
|
BOOST_GEOMETRY_ASSERT(! math::larger(latitude, constants::max_latitude()));
|
||||||
#endif // BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
#endif // BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
||||||
|
|
||||||
BOOST_GEOMETRY_ASSERT(math::smaller(constants::min_longitude(), longitude));
|
BOOST_GEOMETRY_ASSERT(! math::larger_or_equals(constants::min_longitude(), longitude));
|
||||||
BOOST_GEOMETRY_ASSERT(! math::larger(longitude, constants::max_longitude()));
|
BOOST_GEOMETRY_ASSERT(! math::larger(longitude, constants::max_longitude()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user