Skip to content

Commit

Permalink
Stringify options specified as JSON arrays or objects
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed Dec 13, 2016
1 parent f6b1106 commit 6ab2c61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/pipeline.rst
Expand Up @@ -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
................................................................................
Expand Down Expand Up @@ -493,6 +494,3 @@ for the :ref:`writers.las` :cpp:class:`pdal::Stage`.
}
]
}
5 changes: 5 additions & 0 deletions pdal/PipelineReaderJSON.cpp
Expand Up @@ -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.");
Expand Down

0 comments on commit 6ab2c61

Please sign in to comment.