Skip to content

Commit

Permalink
Use std::array over raw array for transforms (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 authored Jan 17, 2024
1 parent 9674fdb commit ea71232
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/grid_map_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include "grid_map_geo/grid_map_geo.hpp"

#include <array>
#include <grid_map_core/GridMapMath.hpp>
#include <grid_map_core/iterators/CircleIterator.hpp>
#include <grid_map_core/iterators/GridMapIterator.hpp>
Expand Down Expand Up @@ -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<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down Expand Up @@ -164,8 +165,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<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down Expand Up @@ -225,8 +226,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<double, 6> geoTransform;
if (dataset->GetGeoTransform(geoTransform.data()) == CE_None) {
originX = geoTransform[0];
originY = geoTransform[3];
pixelSizeX = geoTransform[1];
Expand Down

0 comments on commit ea71232

Please sign in to comment.