Skip to content

Commit

Permalink
Derivative writer refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed Nov 23, 2016
1 parent 99a2431 commit 191301e
Show file tree
Hide file tree
Showing 9 changed files with 1,045 additions and 1,584 deletions.
34 changes: 30 additions & 4 deletions doc/stages/writers.derivative.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ The **Derivative Writer** supports writing of primary topographic attributes.
.. _`GDAL`: http://gdal.org
.. _`GeoTiff`: http://www.gdal.org/frmt_gtiff.html

Example
-------
Example #1
----------

Create a single GeoTIFF with slope values calculated using the D8 method.

.. code-block:: json
Expand All @@ -28,6 +30,25 @@ Example
}
]
}
Example #2
----------

Create multiple GeoTIFFs containing slope, hillshade, and contour curvature
values.

.. code-block:: json
{
"pipeline":[
"inputfile.las",
{
"type":"writers.derivative",
"filename":"outputfile_#.tiff",
"primitive_type":"slope_d8,hillshade,contour_curvature"
}
]
}
Options
Expand All @@ -48,8 +69,13 @@ primitive_type
* tangential_curvature
* total_curvature
* hillshade
* catchment_area

grid_dist_x, grid_dist_y
edge_length
Size of grid cell in X and Y dimensions using native units of the input point
cloud. [Default: 15.0]

altitude
Illumination altitude in degrees (hillshade only). [Default: 45.0]

azimuth
Illumination azimuth in degrees (hillshade only). [Default: 315.0]
4 changes: 2 additions & 2 deletions filters/pmf/PMFFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ std::vector<PointId> PMFFilter::processGroundApprox(PointViewPtr view)
for (PointId i = 0; i < view->size(); ++i)
groundIdx.push_back(i);

MatrixXd ZImin = eigen::createDSM(*view.get(), rows, cols, m_cellSize,
bounds);
MatrixXd ZImin = eigen::createMinMatrix(*view.get(), rows, cols, m_cellSize,
bounds);

// Progressively filter ground returns using morphological open
for (size_t j = 0; j < wsvec.size(); ++j)
Expand Down
7 changes: 4 additions & 3 deletions filters/smrf/SMRFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ std::vector<PointId> SMRFilter::processGround(PointViewPtr view)
// these latter techniques were nearly the same with regards to total error,
// with the spring technique performing slightly better than the k-nearest
// neighbor (KNN) approach.
MatrixXd ZImin = eigen::createDSM(*view.get(), m_numRows, m_numCols,
m_cellSize, m_bounds);
eigen::writeMatrix(ZImin, "zimin.tif", m_cellSize, m_bounds, srs);

MatrixXd ZImin = eigen::createMinMatrix(*view.get(), m_numRows, m_numCols,
m_cellSize, m_bounds);
eigen::writeMatrix(ZImin, "zimin.tif", m_cellSize, m_bounds, srs);

// MatrixXd ZImin_painted = inpaintKnn(cx, cy, ZImin);
// MatrixXd ZImin_painted = TPS(cx, cy, ZImin);
MatrixXd ZImin_painted = expandingTPS(cx, cy, ZImin);
Expand Down
Loading

0 comments on commit 191301e

Please sign in to comment.