mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-25 23:33:53 +00:00
only use OSM tags for complex types
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -53,12 +53,13 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
||||
|
||||
//LOG(LINFO, ("type: ", tokens[0]));
|
||||
|
||||
uint32_t type = classif().GetTypeByPathSafe(strings::Tokenize(tokens[0], "|"));
|
||||
// Get internal feature type
|
||||
std::vector<std::string_view> typeTokens = strings::Tokenize(tokens[0], "|");
|
||||
uint32_t type = classif().GetTypeByPathSafe(typeTokens);
|
||||
|
||||
if (tokens.size() == 2)
|
||||
if (typeTokens.size() <= 2)
|
||||
{
|
||||
// OSM tags can be derived from type name
|
||||
std::vector<std::string_view> typeTokens = strings::Tokenize(tokens[0], "|");
|
||||
// simple feature type: OSM tags can be derived from type name
|
||||
|
||||
ASSERT(typeTokens.size() <= 2, ("OSM tags can not be derived from 3-arity/complex types"));
|
||||
ASSERT(!typeTokens.empty(), ("No type name found"));
|
||||
@@ -79,13 +80,14 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
||||
LOG(LINFO, ("Simple type: Added type ", type, ":", osmTag.key, "=", osmTag.value));
|
||||
|
||||
}
|
||||
else if (tokens.size() > 2)
|
||||
else
|
||||
{
|
||||
// OSM tags are listed in the entry
|
||||
LOG(LINFO, ("Complex type: token size:", tokens.size(), " | osmTags: ", tokens[1]));
|
||||
|
||||
std::vector<std::string_view> osmTagTokens = strings::Tokenize(tokens[1], ",");
|
||||
// complex feature type: OSM tags are listed in the entry
|
||||
ASSERT(tokens.size() > 2, ("OSM tags not listed for complex feature type: ", line));
|
||||
|
||||
std::vector<std::string_view> osmTagTokens = strings::Tokenize(tokens[1], ",");
|
||||
ASSERT(!osmTagTokens.empty(), ("No OSM tag tokens found"));
|
||||
|
||||
// First entry is the best practice way to tag a feature
|
||||
@@ -118,6 +120,8 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
|
||||
|
||||
pos = end + 1;
|
||||
}
|
||||
|
||||
m_storage.insert({type, osmTags});
|
||||
}
|
||||
|
||||
if (lineNumber > 80)
|
||||
|
||||
Reference in New Issue
Block a user