From 432d49e23d5343d0f7f157076c04f64656386d67 Mon Sep 17 00:00:00 2001 From: Tomonobu Saito Date: Fri, 4 Oct 2019 13:50:13 +0900 Subject: [PATCH] bugfix: support multiple delimitor. --- include/extractor/raster_source.hpp | 6 ++++-- src/extractor/raster_source.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/extractor/raster_source.hpp b/include/extractor/raster_source.hpp index 4f39314f3..c1c8d138d 100755 --- a/include/extractor/raster_source.hpp +++ b/include/extractor/raster_source.hpp @@ -47,6 +47,8 @@ class RasterGrid public: RasterGrid(const boost::filesystem::path &filepath, std::size_t _xdim, std::size_t _ydim) { + util::Log() << " filepath : " << filepath; + xdim = _xdim; ydim = _ydim; _data.reserve(ydim * xdim); @@ -65,8 +67,8 @@ class RasterGrid std::vector result; std::string delim (" "); - //boost::split(result, buf, boost::is_any_of(delim), boost::algorithm::token_compress_on); - boost::split(result, buf, boost::is_any_of(delim)); + boost::split(result, buf, boost::is_any_of(delim), boost::algorithm::token_compress_on); + //boost::split(result, buf, boost::is_any_of(delim)); unsigned int x = 0; BOOST_FOREACH(std::string s, result) { _data[(y * xdim) + x] = atoi(s.c_str()); diff --git a/src/extractor/raster_source.cpp b/src/extractor/raster_source.cpp index befae77b7..88291983a 100755 --- a/src/extractor/raster_source.cpp +++ b/src/extractor/raster_source.cpp @@ -124,7 +124,13 @@ int RasterContainer::LoadRasterSource(const std::string &path_string, LoadedSources.push_back(std::move(source)); util::Log() << "[source loader] ok, after " << TIMER_SEC(loading_source) << "s"; - +/* + // for debug : list up all keys and values + util::Log() << "Num of Raster Sources : " << LoadedSourcePaths.size(); + for (auto i = LoadedSourcePaths.begin(); i != LoadedSourcePaths.end(); ++i) { + util::Log() << "Key : " << i->first << " Value: " << i->second; + } +*/ return source_id; }