Skip to content

Commit

Permalink
remove tailing / from input url
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemann16 committed Sep 13, 2018
1 parent 811608e commit 2ae174b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions plugins/i3s/io/i3sReader.cpp
Expand Up @@ -39,13 +39,13 @@ namespace pdal
void I3SReader::initialize(PointTableRef table)
{


//set up arbiter
Json::Value config;
if (log()->getLevel() > LogLevel::Debug4)
config["arbiter"]["verbose"] = true;
m_arbiter.reset(new arbiter::Arbiter(config));


/*Check for */
if (m_filename.size() && m_args.url.empty())
{
m_args.url = m_filename;
Expand All @@ -55,6 +55,9 @@ namespace pdal
if (m_args.url.find("https://") == std::string::npos)
m_args.url = "https://" + m_args.url;
}
//TODO remove tailing '/'
if(m_args.url.back() == '/')
m_args.url.pop_back();

log()->get(LogLevel::Debug) << "Fetching info from " << m_args.url <<
std::endl;
Expand All @@ -77,9 +80,12 @@ namespace pdal
iss >> m_bounds;
}
}
std::cout << "\n\nFileName: " << m_args.url << std::endl;
std::cout << "\nThread Count: " << m_args.threads << std::endl;
std::cout << "Bounds: " << m_args.bounds << std::endl;
log()->get(LogLevel::Debug) << "\n\nFileName: "
<< m_args.url << std::endl;
log()->get(LogLevel::Debug) << "\nThread Count: "
<< m_args.threads << std::endl;
log()->get(LogLevel::Debug) << "Bounds: "
<< m_args.bounds << std::endl;
}

void I3SReader::addArgs(ProgramArgs& args)
Expand Down Expand Up @@ -262,15 +268,15 @@ namespace pdal

p.add([localUrl, this, &view]()
{
binaryFetch(localUrl, view);
createView(localUrl, view);
});
}
std::cout << "\nFinal point count: " << view->size() << std::endl;
const std::size_t pointSize(view->layout()->pointSize());
return 0;
}

void I3SReader::binaryFetch(std::string localUrl, PointViewPtr view)
void I3SReader::createView(std::string localUrl, PointViewPtr view)
{
Pool p(m_args.threads);
std::vector<char> response;
Expand Down
2 changes: 1 addition & 1 deletion plugins/i3s/io/i3sReader.hpp
Expand Up @@ -74,7 +74,7 @@ namespace pdal
public:
I3SReader() : Reader() {};
std::string getName() const;
void binaryFetch(std::string localUrl, PointViewPtr view);
void createView(std::string localUrl, PointViewPtr view);

private:
std::unique_ptr<ILeStream> m_stream;
Expand Down

0 comments on commit 2ae174b

Please sign in to comment.