From 74b67a3c48c1a0281c767bde96e5dd7db024fdc0 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Tue, 16 Jan 2024 22:02:10 -0700 Subject: [PATCH] Use std::array over raw array for transforms Signed-off-by: Ryan Friedman --- src/grid_map_geo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/grid_map_geo.cpp b/src/grid_map_geo.cpp index 82f617e..357faae 100644 --- a/src/grid_map_geo.cpp +++ b/src/grid_map_geo.cpp @@ -39,6 +39,7 @@ #include "grid_map_geo/grid_map_geo.hpp" +#include #include #include #include @@ -66,8 +67,8 @@ bool GridMapGeo::initializeFromGeotiff(const std::string &path, bool align_terra std::cout << std::endl << "Loading GeoTIFF file for gridmap" << std::endl; double originX, originY, pixelSizeX, pixelSizeY; - double geoTransform[6]; - if (dataset->GetGeoTransform(geoTransform) == CE_None) { + std::array geoTransform; + if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) { originX = geoTransform[0]; originY = geoTransform[3]; pixelSizeX = geoTransform[1]; @@ -157,8 +158,8 @@ bool GridMapGeo::addColorFromGeotiff(const std::string &path) { std::cout << std::endl << "Loading color layer from GeoTIFF file for gridmap" << std::endl; double originX, originY, pixelSizeX, pixelSizeY; - double geoTransform[6]; - if (dataset->GetGeoTransform(geoTransform) == CE_None) { + std::array geoTransform; + if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) { originX = geoTransform[0]; originY = geoTransform[3]; pixelSizeX = geoTransform[1]; @@ -218,8 +219,8 @@ bool GridMapGeo::addLayerFromGeotiff(const std::string &layer_name, const std::s std::cout << std::endl << "Loading color layer from GeoTIFF file for gridmap" << std::endl; double originX, originY, pixelSizeX, pixelSizeY; - double geoTransform[6]; - if (dataset->GetGeoTransform(geoTransform) == CE_None) { + std::array geoTransform; + if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) { originX = geoTransform[0]; originY = geoTransform[3]; pixelSizeX = geoTransform[1];