forked from organicmaps/organicmaps
[metadata] Better handling of building:height
This commit is contained in:
parent
45c58107d1
commit
0a61e6e5cd
1 changed files with 8 additions and 4 deletions
|
@ -148,19 +148,23 @@ void RuleDrawer::operator()(FeatureType const & f)
|
|||
{
|
||||
f.ParseMetadata();
|
||||
feature::Metadata const & md = f.GetMetadata();
|
||||
string value = md.Get(feature::Metadata::FMD_HEIGHT);
|
||||
|
||||
double const kDefaultHeightInMeters = 3.0;
|
||||
constexpr double kDefaultHeightInMeters = 3.0;
|
||||
constexpr double kMetersPerLevel = 3.0;
|
||||
double heightInMeters = kDefaultHeightInMeters;
|
||||
|
||||
string value = md.Get(feature::Metadata::FMD_HEIGHT);
|
||||
if (!value.empty())
|
||||
{
|
||||
strings::to_double(value, heightInMeters);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = md.Get(feature::Metadata::FMD_BUILDING_LEVELS);
|
||||
if (!value.empty())
|
||||
{
|
||||
strings::to_double(value, heightInMeters);
|
||||
heightInMeters *= 3.0;
|
||||
if (strings::to_double(value, heightInMeters))
|
||||
heightInMeters *= kMetersPerLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue