diff --git a/doc/stages/writers.gdal.rst b/doc/stages/writers.gdal.rst index 9795e53898..0c5e6e1108 100644 --- a/doc/stages/writers.gdal.rst +++ b/doc/stages/writers.gdal.rst @@ -20,7 +20,7 @@ potentially contributes to the raster's value. it is possible that some points will not be considered at all, including those that may be within the bounds of the raster cell. -The GDAL writer creates rasters using the data in the 'Z' dimension of the +The GDAL writer creates rasters using the data in the 'Z' dimension of the points. In a :ref:`pipeline_command` one can precede the GDAL writer with the ferry filter (:ref:`filters.ferry`) in order to copy data from some other dimension to the 'Z' dimension if desired. @@ -78,7 +78,7 @@ whose values contribute to the cell value is 14.14. "pipeline":[ "pdal/test/data/las/autzen_trim.las", { - "edge_length": 10, + "resolution": 10, "radius": 14.14, "filename":"outputfile.tif" } @@ -92,8 +92,8 @@ Options filename Name of output file. [Required] -edge_length - Length of raster cell edges. [Required] +resolution + Length of raster cell edges in X/Y units. [Required] radius Radius about cell center bounding points to use to calculate a cell value. diff --git a/io/gdal/GDALWriter.cpp b/io/gdal/GDALWriter.cpp index 3c94dc513d..fc4ca7775f 100644 --- a/io/gdal/GDALWriter.cpp +++ b/io/gdal/GDALWriter.cpp @@ -59,7 +59,7 @@ std::string GDALWriter::getName() const void GDALWriter::addArgs(ProgramArgs& args) { args.add("filename", "Output filename", m_filename).setPositional(); - args.add("edge_length", "Length of cell edges (cells are square)", + args.add("resolution", "Cell edge size, in units of X/Y", m_edgeLength).setPositional(); args.add("radius", "Radius from cell center to use to locate influencing " "points", m_radius).setPositional(); @@ -70,6 +70,7 @@ void GDALWriter::addArgs(ProgramArgs& args) "'idw', 'count', 'stdev' or 'all')", m_outputTypeString, {"all"} ); args.add("window_size", "Cell distance for fallback interpolation", m_windowSize); + args.add("nodata", "No data value", m_noData, -9999.0); } @@ -124,7 +125,7 @@ void GDALWriter::write(const PointViewPtr view) view->calculateBounds(m_bounds); size_t width = ((m_bounds.maxx - m_bounds.minx) / m_edgeLength) + 1; size_t height = ((m_bounds.maxy - m_bounds.miny) / m_edgeLength) + 1; - m_grid.reset(new GDALGrid(width, height, m_edgeLength, m_radius, -9999.0, + m_grid.reset(new GDALGrid(width, height, m_edgeLength, m_radius, m_noData, m_outputTypes, m_windowSize)); for (PointId idx = 0; idx < view->size(); ++idx) @@ -152,7 +153,7 @@ void GDALWriter::done(PointTableRef table) pixelToPos[5] = -m_edgeLength; gdal::Raster raster(m_filename, m_drivername, table.spatialReference(), pixelToPos); - + m_grid->finalize(); gdal::GDALError err = raster.open(m_grid->width(), m_grid->height(), diff --git a/io/gdal/GDALWriter.hpp b/io/gdal/GDALWriter.hpp index 4983673026..cdf1d520a6 100644 --- a/io/gdal/GDALWriter.hpp +++ b/io/gdal/GDALWriter.hpp @@ -72,6 +72,7 @@ class PDAL_DLL GDALWriter : public Writer size_t m_windowSize; int m_outputTypes; GDALGridPtr m_grid; + double m_noData; }; }