Skip to content

Commit

Permalink
updated to current pdal and created ability to recognize slpk file ex…
Browse files Browse the repository at this point in the history
…tension
  • Loading branch information
kylemann16 committed Sep 18, 2018
2 parents 3a859e2 + cafff53 commit 81fcbd3
Show file tree
Hide file tree
Showing 118 changed files with 2,163 additions and 76 deletions.
54 changes: 54 additions & 0 deletions doc/stages/readers.ept.rst
@@ -0,0 +1,54 @@
.. _readers.ept:

readers.ept
===========

`Entwine Point Tile`_ (EPT) is a hierarchical octree-based point cloud format suitable for real-time rendering and lossless archival. `Entwine`_ is a producer of this format. The **EPT Reader** supports reading data from the EPT format, including spatially accelerated queries and file reconstruction queries.

Sample EPT datasets of hundreds of billions of points in size may be viewed at http://potree.entwine.io and http://speck.ly.

.. embed::

Example
--------------------------------------------------------------------------------

This example downloads a small area around the the Statue of Liberty from the New York City data set (4.7 billion points) which can be viewed in its entirety in `Potree`_ or `Plasio`_.

.. code-block:: json
{
"pipeline": [
{
"type": "readers.ept",
"filename": "http://na.entwine.io/nyc",
"bounds": "([-8242669, -8242529], [4966549, 4966674])"
},
"statue-of-liberty.las"
]
}
Options
--------------------------------------------------------------------------------

filename
EPT resource from which to read. Because EPT resources do not have a file extension, to specify an EPT resource as a string, it must be prefixed with ``ept://``. For example, ``pdal translate ept://http://na.entwine.io/autzen autzen.laz``. [Required]

bounds
The extents of the resource to select in 2 or 3 dimensions, expressed as a string, e.g.: ``([xmin, xmax], [ymin, ymax], [zmin, zmax])``. If omitted, the entire dataset will be selected.

origin
EPT datasets are lossless aggregations of potentially multiple source files. The *origin* options can be used to select all points from a single source file. This option may be specified as a string or an integral ID.

The string form of this option selects a source file by its original file path. This may be a substring instead of the entire path, but the string must uniquely select only one source file (via substring search). For example, for an EPT dataset created from source files *one.las*, *two.las*, and *two.bpf*, `"one"` is a sufficient selector, but `"two"` is not.

The integral form of this option selects a source file by its ``OriginId`` dimension, which can be found via the files position in EPT metadata file ``entwine-files.json``.

threads
Number of worker threads used to download and process EPT data. A minimum of 4 will be used no matter what value is specified.

.. _Entwine Point Tile: https://github.com/connormanning/entwine/blob/master/doc/entwine-point-tile.md
.. _Entwine: https://entwine.io/
.. _Potree: http://potree.entwine.io/data/nyc.html
.. _Plasio: http://speck.ly/?s=http%3A%2F%2Fc%5B0-7%5D.greyhound.io&r=ept%3A%2F%2Fna.entwine.io%2Fnyc&ca=-0&ce=49.06&ct=-8239196%2C4958509.308%2C337&cd=42640.943&cmd=125978.13&ps=2&pa=0.1&ze=1&c0s=remote%3A%2F%2Fimagery%3Furl%3Dhttp%3A%2F%2Fserver.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FWorld_Imagery%2FMapServer%2Ftile%2F%7B%7Bz%7D%7D%2F%7B%7By%7D%7D%2F%7B%7Bx%7D%7D.jpg

37 changes: 32 additions & 5 deletions filters/HexBinFilter.cpp
Expand Up @@ -34,9 +34,9 @@

#include "HexBinFilter.hpp"

#include "private/hexer/HexGrid.hpp"
#include "private/hexer/HexIter.hpp"
#include <pdal/Polygon.hpp>
#include <pdal/StageFactory.hpp>

using namespace hexer;

Expand All @@ -50,6 +50,25 @@ static PluginInfo const s_info = PluginInfo(

CREATE_STATIC_STAGE(HexBin, s_info)

HexBin::HexBin()
{}


HexBin::~HexBin()
{}

std::string HexBin::getName() const
{
return s_info.name;
}


hexer::HexGrid *HexBin::grid() const
{
return m_grid.get();
}


void HexBin::addArgs(ProgramArgs& args)
{
args.add("sample_size", "Sample size for auto-edge length calculation",
Expand Down Expand Up @@ -82,16 +101,25 @@ void HexBin::ready(PointTableRef table)

void HexBin::filter(PointView& view)
{
PointRef p(view, 0);
for (PointId idx = 0; idx < view.size(); ++idx)
{
double x = view.getFieldAs<double>(pdal::Dimension::Id::X, idx);
double y = view.getFieldAs<double>(pdal::Dimension::Id::Y, idx);
m_grid->addPoint(x, y);
p.setPointId(idx);
processOne(p);
}
m_count += view.size();
}


bool HexBin::processOne(PointRef& point)
{
double x = point.getFieldAs<double>(Dimension::Id::X);
double y = point.getFieldAs<double>(Dimension::Id::Y);
m_grid->addPoint(x, y);
return true;
}


void HexBin::done(PointTableRef table)
{
m_grid->processSample();
Expand All @@ -110,7 +138,6 @@ void HexBin::done(PointTableRef table)
return;
}


std::ostringstream offsets;
offsets << "MULTIPOINT (";
for (int i = 0; i < 6; ++i)
Expand Down
28 changes: 15 additions & 13 deletions filters/HexBinFilter.hpp
Expand Up @@ -35,26 +35,30 @@
#pragma once

#include <pdal/Filter.hpp>
#include <pdal/Streamable.hpp>
#include <pdal/util/ProgramArgs.hpp>


#include "private/hexer/Mathpair.hpp"
#include "private/hexer/HexGrid.hpp"
#include "private/hexer/Processor.hpp"
namespace hexer
{
class HexGrid;
};

namespace pdal
{

class PDAL_DLL HexBin : public Filter
class PDAL_DLL HexBin : public Filter, public Streamable
{
public:
HexBin() : Filter()
{}
std::string getName() const { return "filters.hexbin"; }
HexBin();
~HexBin();

hexer::HexGrid* grid() const { return m_grid.get(); }
private:
HexBin& operator=(const HexBin&) = delete;
HexBin(const HexBin&) = delete;

std::string getName() const;
hexer::HexGrid* grid() const;

private:
std::unique_ptr<hexer::HexGrid> m_grid;
std::string m_xDimName;
std::string m_yDimName;
Expand All @@ -71,10 +75,8 @@ class PDAL_DLL HexBin : public Filter
virtual void addArgs(ProgramArgs& args);
virtual void ready(PointTableRef table);
virtual void filter(PointView& view);
virtual bool processOne(PointRef& point);
virtual void done(PointTableRef table);

HexBin& operator=(const HexBin&); // not implemented
HexBin(const HexBin&); // not implemented
};

} // namespace pdal

0 comments on commit 81fcbd3

Please sign in to comment.