bugfix: support multiple delimitor.

This commit is contained in:
Tomonobu Saito 2019-10-04 13:50:13 +09:00
parent e4aaf07879
commit 432d49e23d
2 changed files with 11 additions and 3 deletions

View File

@ -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<std::string> 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());

View File

@ -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;
}