diff --git a/doc/pipeline.rst b/doc/pipeline.rst index 7eb9115f88..2d160c153c 100644 --- a/doc/pipeline.rst +++ b/doc/pipeline.rst @@ -182,7 +182,8 @@ For more on PDAL stages and their options, check the PDAL documentation on a string. The ``type`` must specify a valid PDAL filter name. * A stage object may have additional members with names corresponding to - stage-specific option names and their respective values. + stage-specific option names and their respective values. Values provided as + JSON objects or arrays will be stringified and parsed within the stage. Filename Globbing ................................................................................ @@ -493,6 +494,3 @@ for the :ref:`writers.las` :cpp:class:`pdal::Stage`. } ] } - - - diff --git a/pdal/PipelineReaderJSON.cpp b/pdal/PipelineReaderJSON.cpp index 231e1feb9a..2d2ca9e502 100644 --- a/pdal/PipelineReaderJSON.cpp +++ b/pdal/PipelineReaderJSON.cpp @@ -325,6 +325,11 @@ Options PipelineReaderJSON::extractOptions(Json::Value& node) options.add(name, node[name].asBool()); else if (node[name].isNull()) options.add(name, ""); + else if (node[name].isArray() || node[name].isObject()) + { + Json::FastWriter w; + options.add(name, w.write(node[name])); + } else throw pdal_error("JSON pipeline: Value of stage option '" + name + "' cannot be converted.");