diff --git a/datasets/bathy/package/BathyFields.cpp b/datasets/bathy/package/BathyFields.cpp index 322e40a5..647f9d27 100644 --- a/datasets/bathy/package/BathyFields.cpp +++ b/datasets/bathy/package/BathyFields.cpp @@ -50,7 +50,7 @@ int BathyFields::luaCreate (lua_State* L) try { - long key_space = LuaObject::getLuaInteger(L, 2, true, 0); + const long key_space = LuaObject::getLuaInteger(L, 2, true, 0); const char* default_asset_name = LuaObject::getLuaString(L, 3, true, "icesat2"); const char* default_resource = LuaObject::getLuaString(L, 4, true, NULL); diff --git a/datasets/icesat2/package/Icesat2Fields.cpp b/datasets/icesat2/package/Icesat2Fields.cpp index 254c396c..7511faf3 100644 --- a/datasets/icesat2/package/Icesat2Fields.cpp +++ b/datasets/icesat2/package/Icesat2Fields.cpp @@ -108,7 +108,7 @@ int Icesat2Fields::luaCreate (lua_State* L) try { - uint64_t key_space = LuaObject::getLuaInteger(L, 2, true, 0); + const uint64_t key_space = LuaObject::getLuaInteger(L, 2, true, 0); const char* default_asset_name = LuaObject::getLuaString(L, 3, true, "icesat2"); const char* default_resource = LuaObject::getLuaString(L, 4, true, NULL); diff --git a/datasets/landsat/package/LandsatHlsRaster.cpp b/datasets/landsat/package/LandsatHlsRaster.cpp index a8cb0d75..0ddf6ba6 100644 --- a/datasets/landsat/package/LandsatHlsRaster.cpp +++ b/datasets/landsat/package/LandsatHlsRaster.cpp @@ -95,8 +95,8 @@ LandsatHlsRaster::LandsatHlsRaster(lua_State *L, RequestFields* rqst_parms, cons /* Create dictionary of bands and algo names to process */ for(int i = 0; i < parms->bands.length(); i++) { - const char* name = parms->bands[i].c_str(); - if( isValidL8Band(name) || isValidS2Band(name) || isValidAlgoName(name)) + const string& name = parms->bands[i]; + if( isValidL8Band(name.c_str()) || isValidS2Band(name.c_str()) || isValidAlgoName(name.c_str())) { /* Add band to dictionary of bands but don't override if already there */ auto it = bandsDict.find(name); diff --git a/datasets/swot/package/SwotFields.cpp b/datasets/swot/package/SwotFields.cpp index e6dbf34b..1e5cc7cb 100644 --- a/datasets/swot/package/SwotFields.cpp +++ b/datasets/swot/package/SwotFields.cpp @@ -49,7 +49,7 @@ int SwotFields::luaCreate (lua_State* L) try { - uint64_t key_space = LuaObject::getLuaInteger(L, 1, true, 0); + const uint64_t key_space = LuaObject::getLuaInteger(L, 1, true, 0); swot_fields = new SwotFields(L, key_space); swot_fields->fromLua(L, 1); diff --git a/packages/geo/GdalRaster.cpp b/packages/geo/GdalRaster.cpp index a69f76cf..dbcc777b 100644 --- a/packages/geo/GdalRaster.cpp +++ b/packages/geo/GdalRaster.cpp @@ -675,19 +675,19 @@ void GdalRaster::resamplePixel(const OGRPoint* poi, RasterSample* sample) { int kernel = 0; - if (parms->sampling_algo == GRIORA_Bilinear) + if (parms->sampling_algo == GeoFields::BILINEAR_ALGO) kernel = 2; /* 2x2 kernel */ - else if (parms->sampling_algo == GRIORA_Cubic) + else if (parms->sampling_algo == GeoFields::CUBIC_ALGO) kernel = 4; /* 4x4 kernel */ - else if (parms->sampling_algo == GRIORA_CubicSpline) + else if (parms->sampling_algo == GeoFields::CUBICSPLINE_ALGO) kernel = 4; /* 4x4 kernel */ - else if (parms->sampling_algo == GRIORA_Lanczos) + else if (parms->sampling_algo == GeoFields::LANCZOS_ALGO) kernel = 6; /* 6x6 kernel */ - else if (parms->sampling_algo == GRIORA_Average) + else if (parms->sampling_algo == GeoFields::AVERAGE_ALGO) kernel = 6; /* No default kernel, pick something */ - else if (parms->sampling_algo == GRIORA_Mode) + else if (parms->sampling_algo == GeoFields::MODE_ALGO) kernel = 6; /* No default kernel, pick something */ - else if (parms->sampling_algo == GRIORA_Gauss) + else if (parms->sampling_algo == GeoFields::GAUSS_ALGO) kernel = 6; /* No default kernel, pick something */ windowSize = kernel + 1; // Odd window size around pixel diff --git a/packages/geo/GeoFields.cpp b/packages/geo/GeoFields.cpp index e606c17b..a1f679d1 100644 --- a/packages/geo/GeoFields.cpp +++ b/packages/geo/GeoFields.cpp @@ -319,7 +319,7 @@ void convertFromLua(lua_State* L, int index, GeoFields::sampling_algo_t& v) } else { - long n = LuaObject::getLuaInteger(L, index); + const long n = LuaObject::getLuaInteger(L, index); switch(static_cast(n)) { case GeoFields::NEARESTNEIGHBOUR_ALGO: break; // valid value diff --git a/packages/geo/GeoFields.h b/packages/geo/GeoFields.h index 7ef7f315..f253ae1a 100644 --- a/packages/geo/GeoFields.h +++ b/packages/geo/GeoFields.h @@ -89,7 +89,7 @@ class GeoFields: public FieldDictionary * Typedefs *--------------------------------------------------------------------*/ - typedef struct { + typedef struct GeoBBox { double lon_min {0.0}; double lat_min {0.0}; double lon_max {0.0}; diff --git a/packages/geo/geo.cpp b/packages/geo/geo.cpp index eeadc4fa..b024e0cb 100644 --- a/packages/geo/geo.cpp +++ b/packages/geo/geo.cpp @@ -35,11 +35,6 @@ #include "geo.h" -#ifdef __unittesting__ -#include "UT_RasterSubset.h" -#include "UT_RasterSample.h" -#endif - #include "GeoRaster.h" #include "GeoIndexedRaster.h" #include "GeoJsonRaster.h" @@ -48,6 +43,10 @@ #include "GeoFields.h" #include "GeoLib.h" #include "RasterSampler.h" +#ifdef __unittesting__ +#include "UT_RasterSubset.h" +#include "UT_RasterSample.h" +#endif #include #include