MCPcopy Create free account
hub / github.com/comaps/comaps / ValidateAndFormat_building_levels

Method ValidateAndFormat_building_levels

generator/osm2meta.cpp:262–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262std::string MetadataTagProcessorImpl::ValidateAndFormat_building_levels(std::string v)
263{
264 // Some mappers use full width unicode digits. We can handle that.
265 strings::NormalizeDigits(v);
266 // value of building_levels is only one number
267 double levels;
268 if (Prefix2Double(v, levels) && levels >= 0 && levels <= kMaxBuildingLevelsInTheWorld)
269 return strings::to_string_dac(levels, 1);
270
271 return {};
272}
273
274std::string MetadataTagProcessorImpl::ValidateAndFormat_level(std::string v)
275{

Callers 1

UNIT_TESTFunction · 0.80

Calls 3

NormalizeDigitsFunction · 0.85
Prefix2DoubleFunction · 0.85
to_string_dacFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.64