#ifndef _OSMAND_MAP_OBJECTS_H #define _OSMAND_MAP_OBJECTS_H #include #include #include #include "common.h" typedef pair tag_value; typedef pair int_pair; typedef vector< pair > coordinates; class MapDataObject { static const unsigned int UNDEFINED_STRING = INT_MAX; public: std::vector types; std::vector additionalTypes; coordinates points; std::vector < coordinates > polygonInnerCoordinates; UNORDERED(map)< std::string, unsigned int> stringIds; UNORDERED(map)< std::string, std::string > objectNames; bool area; long long id; // bool cycle(){ return points[0] == points[points.size() -1]; } bool containsAdditional(std::string key, std::string val) { std::vector::iterator it = additionalTypes.begin(); while (it != additionalTypes.end()) { if (it->first == key && it->second == val) { return true; } it++; } return false; } bool contains(std::string key, std::string val) { std::vector::iterator it = types.begin(); while (it != types.end()) { if (it->first == key) { return it->second == val; } it++; } return false; } int getSimpleLayer() { std::vector::iterator it = additionalTypes.begin(); bool tunnel = false; bool bridge = false; while (it != additionalTypes.end()) { if (it->first == "layer") { if(it->second.length() > 0) { if(it->second[0] == '-'){ return -1; } else if (it->second[0] == '0'){ return 0; } else { return 1; } } } else if (it->first == "tunnel") { tunnel = "yes" == it->second; } else if (it->first == "bridge") { bridge = "yes" == it->second; } it++; } if (tunnel) { return -1; } else if (bridge) { return 1; } return 0; } }; void deleteObjects(std::vector & v); #endif /*_OSMAND_MAP_OBJECTS_H*/