From f15d87cb2385c69bfa2ce80946b84558b8d7d34c Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Fri, 2 Oct 2015 19:28:46 -0500 Subject: [PATCH] Make default behavior follow previous implementation. --- doc/stages/filters.colorization.rst | 3 +-- filters/colorization/ColorizationFilter.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/stages/filters.colorization.rst b/doc/stages/filters.colorization.rst index 435d637ee1..35ad2adb0e 100644 --- a/doc/stages/filters.colorization.rst +++ b/doc/stages/filters.colorization.rst @@ -44,8 +44,7 @@ dimensions Either or both of band number and scale factor may be omitted as may ':' separators if the data is not ambiguous. If not supplied, band numbers begin at 1 and increment from the band number of the previous dimension. - If not supplied, the scaling factor is 1.0. If fewer than three dimensions - are supplied, the defaults are applied where appropriate. + If not supplied, the scaling factor is 1.0. [Default: "Red:1:1.0, Green:2:1.0, Blue:3:1.0"] .. _GDAL: http://gdal.org diff --git a/filters/colorization/ColorizationFilter.cpp b/filters/colorization/ColorizationFilter.cpp index 2df8699b28..57747f8776 100644 --- a/filters/colorization/ColorizationFilter.cpp +++ b/filters/colorization/ColorizationFilter.cpp @@ -149,19 +149,20 @@ void ColorizationFilter::processOptions(const Options& options) throw pdal_error("Option 'dimension' no longer supported. Use " "'dimensions' instead."); - StringList dims = options.getValueOrDefault("dimensions"); + StringList defaultDims; + defaultDims.push_back("Red"); + defaultDims.push_back("Green"); + defaultDims.push_back("Blue"); - m_bands.emplace_back("Red", 1, 1.0); - m_bands.emplace_back("Green", 2, 1.0); - m_bands.emplace_back("Blue", 3, 1.0); + StringList dims = + options.getValueOrDefault("dimensions", defaultDims); - size_t i = 0; uint32_t defaultBand = 1; for (std::string& dim : dims) { BandInfo bi = parseDim(dim, defaultBand); defaultBand = bi.m_band + 1; - m_bands[i++] = bi; + m_bands.push_back(bi); } }