bugfix: support multiple delimitor.
This commit is contained in:
parent
e4aaf07879
commit
432d49e23d
@ -47,6 +47,8 @@ class RasterGrid
|
|||||||
public:
|
public:
|
||||||
RasterGrid(const boost::filesystem::path &filepath, std::size_t _xdim, std::size_t _ydim)
|
RasterGrid(const boost::filesystem::path &filepath, std::size_t _xdim, std::size_t _ydim)
|
||||||
{
|
{
|
||||||
|
util::Log() << " filepath : " << filepath;
|
||||||
|
|
||||||
xdim = _xdim;
|
xdim = _xdim;
|
||||||
ydim = _ydim;
|
ydim = _ydim;
|
||||||
_data.reserve(ydim * xdim);
|
_data.reserve(ydim * xdim);
|
||||||
@ -65,8 +67,8 @@ class RasterGrid
|
|||||||
|
|
||||||
std::vector<std::string> result;
|
std::vector<std::string> result;
|
||||||
std::string delim (" ");
|
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::algorithm::token_compress_on);
|
||||||
boost::split(result, buf, boost::is_any_of(delim));
|
//boost::split(result, buf, boost::is_any_of(delim));
|
||||||
unsigned int x = 0;
|
unsigned int x = 0;
|
||||||
BOOST_FOREACH(std::string s, result) {
|
BOOST_FOREACH(std::string s, result) {
|
||||||
_data[(y * xdim) + x] = atoi(s.c_str());
|
_data[(y * xdim) + x] = atoi(s.c_str());
|
||||||
|
@ -124,7 +124,13 @@ int RasterContainer::LoadRasterSource(const std::string &path_string,
|
|||||||
LoadedSources.push_back(std::move(source));
|
LoadedSources.push_back(std::move(source));
|
||||||
|
|
||||||
util::Log() << "[source loader] ok, after " << TIMER_SEC(loading_source) << "s";
|
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;
|
return source_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user