mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-25 23:33:53 +00:00
@@ -2,7 +2,23 @@
|
||||
|
||||
#include "editor/feature_type_to_osm.hpp"
|
||||
|
||||
#include "indexer/classificator.hpp"
|
||||
#include "indexer/classificator_loader.hpp"
|
||||
|
||||
using namespace editor;
|
||||
|
||||
UNIT_TEST(testIfTestRuns)
|
||||
{
|
||||
LOG(LINFO, ("New Test ran!"));
|
||||
LOG(LINFO, ("Hello from type to osm test!"));
|
||||
|
||||
classificator::Load();
|
||||
|
||||
FeatureTypeToOSM typeToOsm;
|
||||
uint32_t type = classif().GetTypeByReadableObjectName("amenity-restaurant");
|
||||
std::vector<OSMTag> resultVector = typeToOsm.typeToOSM(type);
|
||||
|
||||
TEST_EQUAL(resultVector.size(), 1, ());
|
||||
OSMTag const & result = resultVector.front();
|
||||
TEST_EQUAL(result.key, "amenity", ());
|
||||
TEST_EQUAL(result.value, "restaurant", ());
|
||||
}
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
#include "editor/feature_type_to_osm.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
#include "indexer/classificator.hpp"
|
||||
|
||||
namespace OSM
|
||||
namespace editor
|
||||
{
|
||||
void OSM::FeatureTypeToOSM::typeToOSM(uint32_t type)
|
||||
void FeatureTypeToOSM::loadConfigFile() {
|
||||
LOG(LINFO, ("Hello from loadConfigFile"));
|
||||
}
|
||||
|
||||
std::vector<OSMTag> FeatureTypeToOSM::typeToOSM(uint32_t type)
|
||||
{
|
||||
LOG(LDEBUG, ("Computing typeToOSM for Type: ", type, "/ "));
|
||||
LOG(LINFO, ("Computing typeToOSM for Type: ", type, "/ " , classif().GetReadableObjectName(type)));
|
||||
|
||||
std::vector<OSMTag> result;
|
||||
|
||||
result.push_back(OSMTag{"amenity", "restaurant"});
|
||||
|
||||
return result;
|
||||
}
|
||||
} // namespace osm
|
||||
@@ -1,13 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace OSM
|
||||
namespace editor
|
||||
{
|
||||
struct OSMTag
|
||||
{
|
||||
std::string key;
|
||||
std::string value;
|
||||
};
|
||||
|
||||
class FeatureTypeToOSM
|
||||
{
|
||||
|
||||
public:
|
||||
static void typeToOSM(uint32_t type);
|
||||
void loadConfigFile();
|
||||
//static void typeToOSM(uint32_t type);
|
||||
std::vector<OSMTag> typeToOSM(uint32_t type);
|
||||
|
||||
private:
|
||||
//std::vector<OSMTag> storage;
|
||||
|
||||
};
|
||||
} // namespace osm
|
||||
Reference in New Issue
Block a user