MCPcopy Create free account
hub / github.com/OSGeo/PROJ / baseExportToJSON

Method baseExportToJSON

src/iso19111/common.cpp:1272–1293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1270// ---------------------------------------------------------------------------
1271
1272void ObjectUsage::baseExportToJSON(JSONFormatter *formatter) const {
1273
1274 auto writer = formatter->writer();
1275 if (formatter->outputUsage()) {
1276 const auto &l_domains = domains();
1277 if (l_domains.size() == 1) {
1278 l_domains[0]->_exportToJSON(formatter);
1279 } else if (!l_domains.empty()) {
1280 writer->AddObjKey("usages");
1281 auto arrayContext(writer->MakeArrayContext(false));
1282 for (const auto &domain : l_domains) {
1283 auto objContext(writer->MakeObjectContext());
1284 domain->_exportToJSON(formatter);
1285 }
1286 }
1287 }
1288
1289 if (formatter->outputId()) {
1290 formatID(formatter);
1291 }
1292 formatRemarks(formatter);
1293}
1294
1295// ---------------------------------------------------------------------------
1296

Callers

nothing calls this directly

Calls 7

writerMethod · 0.80
outputUsageMethod · 0.80
sizeMethod · 0.80
AddObjKeyMethod · 0.80
outputIdMethod · 0.80
_exportToJSONMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected