Import an exchange set
importExchangeSet is the main entry point. It reads the set, plans the updates against what the store already holds, builds the changed cells and writes them.
Example
1
#include <GeoDataChart/ChartStore.h>
2
#include <GeoDataEnc/Importer.h>
3
4
using namespace GeoData;
5
6
DbOptions db;
7
db.type = DbOptions::Type::SpatiaLite;
8
db.filePath = "chart.sqlite";
9
10
chart::ChartStore store(db);
11
if (!store.open() || !store.createSchema())
12
return 1;
13
14
enc::ImportOptions opts;
15
opts.layerId = "enc";
16
opts.catalogRoot = "/path/to/catalog";
17
18
const enc::UpdateReport report = enc::importExchangeSet(store, "/path/to/ENC_ROOT", opts);
Options
Field | Default | Meaning |
|---|---|---|
| empty | Layer the cells belong to |
| | Refuse a set without |
| | Reject update records with no target or a wrong version |
| | Concurrent builds, |
| empty | Directory with |
Do not mix strict and non-strict imports in one store.
Report
UpdateReport has three fields:
files: one outcome per file of this load, the same rows as the update log.cells: a summary of each cell of the set now in the library.error: empty when the set was read and everything was written.
Chart library
1
std::vector<enc::CellLibraryRow> rows = enc::cellLibrary(store);
2
std::vector<enc::FileOutcome> log = enc::updateLog(store, "US5MD11M");
3
bool removed = enc::removeCell(store, "US5MD11M");
Next