diff --git a/include/road_map.h b/include/road_map.h index f7d8138deb7049858a20aef69ffaa164ea611537..b584499974596faf645a4f019d8e4158ca32766b 100644 --- a/include/road_map.h +++ b/include/road_map.h @@ -36,6 +36,7 @@ class CRoadMap std::vector<CRoad *> roads; std::vector<CJunction *> junctions; double resolution; + int utm_zone; protected: void free(void); unsigned get_next_segment_id(void); @@ -55,6 +56,8 @@ class CRoadMap void load_osm(const std::string &filename); void set_resolution(double resolution); double get_resolution(void); + void set_utm_zone(int zone); + int get_utm_zone(void); std::vector<unsigned int> get_path_sub_roadmap(std::vector<unsigned int> &segment_ids,CRoadMap &new_road_map); double get_path_length(std::vector<unsigned int> &segment_ids); /* connectivity */ diff --git a/src/road_map.cpp b/src/road_map.cpp index dd9e4bb5e419032536bfee23ac818834ba085844..81a08efa3dd72883b2b3a1e2f0c2ab02068cddc7 100644 --- a/src/road_map.cpp +++ b/src/road_map.cpp @@ -14,6 +14,7 @@ CRoadMap::CRoadMap() { this->resolution=0.1; + this->utm_zone=31; this->next_segment_id=0; this->next_road_id=0; this->next_junction_id=0; @@ -383,6 +384,7 @@ void CRoadMap::save_opendrive(const std::string &filename) void CRoadMap::load_osm(const std::string &filename) { COSMMap road_map; + road_map.set_utm_zone(this->utm_zone); this->free(); road_map.load(filename); @@ -403,6 +405,16 @@ double CRoadMap::get_resolution(void) return this->resolution; } +void CRoadMap::set_utm_zone(int zone) +{ + this->utm_zone=zone; +} + +int CRoadMap::get_utm_zone(void) +{ + return this->utm_zone; +} + std::vector<unsigned int> CRoadMap::get_path_sub_roadmap(std::vector<unsigned int> &segment_ids,CRoadMap &new_road_map) { std::map<CRoad *,CRoad *> road_ref_update;