forked from organicmaps/organicmaps
[generator:regions] Fix commutative property of CompareAffiliation() for zero area comparison
This commit is contained in:
parent
e488e583b3
commit
390d80f81e
1 changed files with 4 additions and 2 deletions
|
@ -246,14 +246,16 @@ int RegionsBuilder::CompareAffiliation(LevelRegion const & l, LevelRegion const
|
|||
|
||||
auto const lArea = l.GetArea();
|
||||
auto const rArea = r.GetArea();
|
||||
if (0.5 * lArea >= rArea)
|
||||
if (0.5 * lArea > rArea)
|
||||
{
|
||||
ASSERT_GREATER(0.5 * lArea, 0, ());
|
||||
LOG(LDEBUG, ("Region", l.GetId(), GetRegionNotation(l), "contains partly", r.GetId(),
|
||||
GetRegionNotation(r)));
|
||||
return 1;
|
||||
}
|
||||
if (0.5 * rArea >= lArea)
|
||||
if (0.5 * rArea > lArea)
|
||||
{
|
||||
ASSERT_GREATER(0.5 * rArea, 0, ());
|
||||
LOG(LDEBUG, ("Region", r.GetId(), GetRegionNotation(r), "contains partly", l.GetId(),
|
||||
GetRegionNotation(l)));
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue