Renamed tag envelope_area -> bbox_area

This commit is contained in:
Constantin Shalnev 2015-10-08 11:37:31 +03:00
parent 1c5f0f95c8
commit 8859135a16
3 changed files with 13 additions and 13 deletions

View file

@ -1,3 +1,3 @@
population
name
envelope_area
bbox_area

View file

@ -111,8 +111,8 @@ bool GetName(FeatureType const & ft, string & name)
return true;
}
// Feature tag value evaluator for tag 'envelope_area' (envelope area in sq.meters)
bool GetEnvelopeArea(FeatureType const & ft, double & sqM)
// Feature tag value evaluator for tag 'bbox_area' (bounding box area in sq.meters)
bool GetBoundingBoxArea(FeatureType const & ft, double & sqM)
{
if (feature::GEOM_AREA != ft.GetFeatureType())
return false;
@ -153,7 +153,7 @@ unique_ptr<ISelector> ParseSelector(string const & str)
{
return make_unique<Selector<string>>(&GetName, e.m_operator, e.m_value);
}
else if (e.m_tag == "envelope_area")
else if (e.m_tag == "bbox_area")
{
double value = 0;
if (!e.m_value.empty() && (!strings::to_double(e.m_value, value) || value < 0))
@ -162,7 +162,7 @@ unique_ptr<ISelector> ParseSelector(string const & str)
LOG(LDEBUG, ("Invalid selector:", str));
return unique_ptr<ISelector>();
}
return make_unique<Selector<double>>(&GetEnvelopeArea, e.m_operator, value);
return make_unique<Selector<double>>(&GetBoundingBoxArea, e.m_operator, value);
}
// Add new tag here

View file

@ -19,9 +19,9 @@ UNIT_TEST(TestDruleSelectorIsSet)
UNIT_TEST(TestDruleSelectorIsSet2)
{
SelectorExpression e;
TEST(ParseSelector("envelope_area", e), ());
TEST(ParseSelector("bbox_area", e), ());
TEST_EQUAL("envelope_area", e.m_tag, ());
TEST_EQUAL("bbox_area", e.m_tag, ());
TEST_EQUAL("", e.m_value, ());
TEST_EQUAL(SelectorOperatorIsSet, e.m_operator, ());
}
@ -39,9 +39,9 @@ UNIT_TEST(TestDruleSelectorIsNotSet)
UNIT_TEST(TestDruleSelectorIsNotSet2)
{
SelectorExpression e;
TEST(ParseSelector("!envelope_area", e), ());
TEST(ParseSelector("!bbox_area", e), ());
TEST_EQUAL("envelope_area", e.m_tag, ());
TEST_EQUAL("bbox_area", e.m_tag, ());
TEST_EQUAL("", e.m_value, ());
TEST_EQUAL(SelectorOperatorIsNotSet, e.m_operator, ());
}
@ -79,9 +79,9 @@ UNIT_TEST(TestDruleSelectorLess)
UNIT_TEST(TestDruleSelectorLess2)
{
SelectorExpression e;
TEST(ParseSelector("envelope_area<1000", e), ());
TEST(ParseSelector("bbox_area<1000", e), ());
TEST_EQUAL("envelope_area", e.m_tag, ());
TEST_EQUAL("bbox_area", e.m_tag, ());
TEST_EQUAL("1000", e.m_value, ());
TEST_EQUAL(SelectorOperatorLess, e.m_operator, ());
}
@ -99,9 +99,9 @@ UNIT_TEST(TestDruleSelectorGreater)
UNIT_TEST(TestDruleSelectorGreater2)
{
SelectorExpression e;
TEST(ParseSelector("envelope_area>1000", e), ());
TEST(ParseSelector("bbox_area>1000", e), ());
TEST_EQUAL("envelope_area", e.m_tag, ());
TEST_EQUAL("bbox_area", e.m_tag, ());
TEST_EQUAL("1000", e.m_value, ());
TEST_EQUAL(SelectorOperatorGreater, e.m_operator, ());
}