mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-25 23:33:53 +00:00
@@ -1,9 +1,11 @@
|
||||
#include "editor/feature_type_to_osm.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
#include "coding/reader_streambuf.hpp"
|
||||
#include "indexer/classificator.hpp"
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
|
||||
namespace editor
|
||||
{
|
||||
void FeatureTypeToOSM::loadConfigFile() {
|
||||
@@ -14,6 +16,44 @@ void FeatureTypeToOSM::loadConfigFile() {
|
||||
std::unique_ptr<ModelReader> reader = p.GetReader("mapcss-mapping.csv");
|
||||
|
||||
LOG(LINFO, ("File has size ", reader->Size()));
|
||||
|
||||
ReaderStreamBuf buffer(std::move(reader));
|
||||
std::istream s(&buffer);
|
||||
|
||||
std::string line;
|
||||
|
||||
int lineNumber = 0;
|
||||
while (s.good())
|
||||
{
|
||||
++lineNumber;
|
||||
getline(s, line);
|
||||
strings::Trim(line);
|
||||
|
||||
// skip empty lines and comments
|
||||
if (line.empty() || line[0] == '#')
|
||||
continue;
|
||||
|
||||
LOG(LINFO, ("Reading line: ", line));
|
||||
|
||||
std::vector<std::string_view> tokens = strings::Tokenize(line, ";");
|
||||
|
||||
if (tokens.size() == 2)
|
||||
{
|
||||
// OSM tags can be derived from type name
|
||||
LOG(LINFO, ("simple type: ", tokens[0]));
|
||||
}
|
||||
else if (tokens.size() > 2)
|
||||
{
|
||||
LOG(LINFO, ("token size:", tokens.size(), " | osmTags: ", tokens[1]));
|
||||
}
|
||||
|
||||
|
||||
if (lineNumber > 70)
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
ASSERT_FAIL("Don't run further tests-------------------");
|
||||
}
|
||||
|
||||
std::vector<OSMTag> FeatureTypeToOSM::typeToOSM(uint32_t type)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "editor/xml_feature.hpp"
|
||||
|
||||
#include "editor/feature_type_to_osm.hpp"
|
||||
//#include "editor/feature_type_to_osm.hpp"
|
||||
#include "editor/keys_to_remove.hpp"
|
||||
|
||||
#include "indexer/classificator.hpp"
|
||||
|
||||
Reference in New Issue
Block a user