Skip to content

Commit

Permalink
PROJBasedOperation PROJJSON export: issues an empty 'parameters' arra…
Browse files Browse the repository at this point in the history
…y if needed (refs #3076)
  • Loading branch information
rouault committed Mar 9, 2022
1 parent 64f2a6b commit 8136b72
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/iso19111/operation/projbasedoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,13 @@ void PROJBasedOperation::_exportToJSON(
method()->_exportToJSON(formatter);

const auto &l_parameterValues = parameterValues();
if (!l_parameterValues.empty()) {
writer->AddObjKey("parameters");
{
auto parametersContext(writer->MakeArrayContext(false));
for (const auto &genOpParamvalue : l_parameterValues) {
formatter->setAllowIDInImmediateChild();
formatter->setOmitTypeInImmediateChild();
genOpParamvalue->_exportToJSON(formatter);
}
writer->AddObjKey("parameters");
{
auto parametersContext(writer->MakeArrayContext(false));
for (const auto &genOpParamvalue : l_parameterValues) {
formatter->setAllowIDInImmediateChild();
formatter->setOmitTypeInImmediateChild();
genOpParamvalue->_exportToJSON(formatter);
}
}
}
Expand Down

0 comments on commit 8136b72

Please sign in to comment.