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
+4 -2
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());