From 1bf1ba61249d1f4f65e01cb0f2ebd504d9ceb638 Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Fri, 10 Nov 2023 13:04:58 +0100
Subject: [PATCH] Add set/get_utm_zone functions

---
 include/road_map.h |  3 +++
 src/road_map.cpp   | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/road_map.h b/include/road_map.h
index f7d8138..b584499 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 dd9e4bb..81a08ef 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;
-- 
GitLab