File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ bool GridMapGeo::initializeFromGeotiff(const std::string &path) {
85
85
86
86
const OGRSpatialReference *spatial_ref = dataset->GetSpatialRef ();
87
87
std::string name_coordinate = spatial_ref->GetAttrValue (" geogcs" );
88
+ std::string epsg_code = spatial_ref->GetAttrValue (" AUTHORITY" , 1 );
88
89
// Get image metadata
89
90
unsigned width = dataset->GetRasterXSize ();
90
91
unsigned height = dataset->GetRasterYSize ();
@@ -99,7 +100,7 @@ bool GridMapGeo::initializeFromGeotiff(const std::string &path) {
99
100
100
101
double mapcenter_e = originX + pixelSizeX * width * 0.5 ;
101
102
double mapcenter_n = originY + pixelSizeY * height * 0.5 ;
102
- maporigin_.espg = ESPG::CH1903_LV03 ;
103
+ maporigin_.espg = static_cast < ESPG>( std::stoi (epsg_code)) ;
103
104
maporigin_.position = Eigen::Vector3d (mapcenter_e, mapcenter_n, 0.0 );
104
105
105
106
Eigen::Vector2d position{Eigen::Vector2d::Zero ()};
You can’t perform that action at this time.
0 commit comments