Skip to content

Commit

Permalink
provide the bbox 'boundary' entry to the filters.stats when no hexbin…
Browse files Browse the repository at this point in the history
… is linked #920
  • Loading branch information
hobu committed Feb 11, 2016
1 parent 9ceb590 commit eb16705
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/compilation/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Python installation
********************************************************************

Since PDAL 1.0.0 there is a Python extension to execute pipelines
and read its output as a numpy array.
Beginning in PDAL 1.0.0, a Python extension to execute pipelines
and read its output as a numpy array is available.

To install it need to compile and install :ref:`PDAL <building>` and
then install the PDAL Python extension
Expand Down
2 changes: 2 additions & 0 deletions filters/stats/StatsFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void StatsFilter::extractMetadata(PointTableRef table)
MetadataNode mbox = Utils::toMetadata(box);
MetadataNode box_metadata = m_metadata.add("bbox");
MetadataNode metadata = box_metadata.add("native");
MetadataNode boundary = metadata.add("boundary", p.json());
MetadataNode bbox = metadata.add(mbox);
SpatialReference ref = table.anySpatialReference();
// if we don't get an SRS from the PointTableRef,
Expand All @@ -209,6 +210,7 @@ void StatsFilter::extractMetadata(PointTableRef table)
MetadataNode epsg_4326_box = Utils::toMetadata(ddbox);
MetadataNode dddbox = box_metadata.add("EPSG:4326");
dddbox.add(epsg_4326_box);
MetadataNode ddboundary = dddbox.add("boundary", pdd.json());


}
Expand Down
9 changes: 9 additions & 0 deletions kernels/info/InfoKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,17 @@ void InfoKernel::setup(const std::string& filename)
}
if (m_boundary)
{
#ifndef PDAL_HAVE_HEXER
throw pdal_error("Unable to compute boundary -- "
"http://github.com/hobu/hexer is not linked. "
"See the \"boundary\" member in \"stats\" for a coarse bounding box");
#else
m_hexbinStage = &(m_manager->addFilter("filters.hexbin"));
m_hexbinStage->setOptions(options);
m_hexbinStage->setInput(*stage);
stage = m_hexbinStage;
Options readerOptions;
#endif
}
}

Expand Down Expand Up @@ -352,14 +358,17 @@ void InfoKernel::dump(MetadataNode& root)
assert(viewSet.size() == 1);
root.add(dumpPoints(*viewSet.begin()).clone("points"));
}

if (m_queryPoint.size())
{
PointViewSet viewSet = m_manager->views();
assert(viewSet.size() == 1);
root.add(dumpQuery(*viewSet.begin()));
}

if (m_showMetadata)
root.add(m_reader->getMetadata().clone("metadata"));

if (m_boundary)
{
PointViewSet viewSet = m_manager->views();
Expand Down

0 comments on commit eb16705

Please sign in to comment.