mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
@@ -40,7 +40,7 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
|||||||
line.back() != ';')
|
line.back() != ';')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::vector<std::string_view> rowTokens = strings::Tokenize(line, ";");
|
std::vector<std::string_view> const rowTokens = strings::Tokenize(line, ";");
|
||||||
if (rowTokens.size() < 2)
|
if (rowTokens.size() < 2)
|
||||||
{
|
{
|
||||||
ASSERT(false, ("Invalid feature type definition:", line));
|
ASSERT(false, ("Invalid feature type definition:", line));
|
||||||
@@ -48,8 +48,8 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get internal feature type
|
// Get internal feature type
|
||||||
std::vector<std::string_view> featureTypeTokens = strings::Tokenize(rowTokens[0], "|");
|
std::vector<std::string_view> const featureTypeTokens = strings::Tokenize(rowTokens[0], "|");
|
||||||
uint32_t type = classif().GetTypeByPathSafe(featureTypeTokens);
|
uint32_t const type = classif().GetTypeByPathSafe(featureTypeTokens);
|
||||||
ASSERT(type != IndexAndTypeMapping::INVALID_TYPE, ("Feature with invalid type:", line));
|
ASSERT(type != IndexAndTypeMapping::INVALID_TYPE, ("Feature with invalid type:", line));
|
||||||
|
|
||||||
if (rowTokens.size() == 2)
|
if (rowTokens.size() == 2)
|
||||||
@@ -77,10 +77,10 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// OSM tags are listed in the feature type entry
|
// OSM tags are listed in the feature type entry
|
||||||
std::vector<std::string_view> osmTagTokens = strings::Tokenize(rowTokens[1], ",");
|
std::vector<std::string_view> const osmTagTokens = strings::Tokenize(rowTokens[1], ",");
|
||||||
|
|
||||||
// First entry is the best practice way to tag a feature
|
// First entry is the best practice way to tag a feature
|
||||||
std::string_view osmTagList = osmTagTokens[0];
|
std::string_view const osmTagList = osmTagTokens[0];
|
||||||
|
|
||||||
// Process OSM tag list (e.g. "[tourism=information][information=office]")
|
// Process OSM tag list (e.g. "[tourism=information][information=office]")
|
||||||
std::vector<OSMTag> osmTags;
|
std::vector<OSMTag> osmTags;
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ void XMLFeature::SetOSMTagsForType(uint32_t type)
|
|||||||
|
|
||||||
std::vector<OSMTag> const & osmTags = GetOSMTranslator().OsmTagsFromType(type);
|
std::vector<OSMTag> const & osmTags = GetOSMTranslator().OsmTagsFromType(type);
|
||||||
|
|
||||||
for(auto const & osmTag : osmTags)
|
for (auto const & osmTag : osmTags)
|
||||||
SetTagValue(osmTag.key, osmTag.value);
|
SetTagValue(osmTag.key, osmTag.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user