Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
survey.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/**
19 * @file survey.cpp
20 * @brief Command-line entry point for completed-session PANGEA mapping.
21 * @details Survey processing consumes saved photos and validated session
22 * metadata; it is not part of the camera trigger path. Separate per-user locks
23 * exclude both another survey and the live PANGEA worker so two independent
24 * consumers cannot compete for memory or checkpoint files.
25 */
26#include "application_runtime.h"
27#include "version.h"
28#include "map_config.h"
29#include "ortho_map.h"
30#include "map_exif.h"
31#include "map_writer.h"
32#include "map_progress.h"
33#include "jpeg_encoder.h"
34#include "map_resources.h"
35#include <atomic>
36#include <chrono>
37#include <thread>
38#include <functional>
39#include <cstring>
40#include <sys/file.h>
41#include <sys/types.h>
42#include <unistd.h>
43#include <signal.h>
44#include <fcntl.h>
45
46using Clock = std::chrono::steady_clock;
47static std::atomic<sig_atomic_t> stopping{0};
48static_assert(decltype(stopping)::is_always_lock_free,
49 "Signal cancellation requires lock-free atomic access");
50static std::unique_ptr<pangea_survey::MapResources> resources;
51static fs::path activePauseFile;
52static int liveCpuPercent = 0;
53static double liveCpuStarted = 0;
54static Clock::time_point liveStarted;
55/** @brief Read cumulative CPU time across the mapping process's threads.
56 * @return CPU seconds, independent of elapsed wall time.
57 * @throws std::runtime_error If the process CPU clock cannot be read. */
58static double processCpuSeconds() {
59 struct timespec value{};
60 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &value) != 0)
61 throw std::runtime_error("Cannot measure mapping CPU time");
62 return value.tv_sec + value.tv_nsec / 1e9;
63}
64/** @brief Check cancellation at a cooperative mapping boundary.
65 * @return True when a stop signal has been recorded.
66 * @details Wait out operator pauses and throttle against cumulative CPU time.
67 * Poll in short sleeps so cancellation remains responsive while paused. */
68static bool isStopping() {
69 while (!stopping && !activePauseFile.empty() && fs::exists(activePauseFile))
70 std::this_thread::sleep_for(std::chrono::milliseconds(250));
71 if (liveCpuPercent) {
72 const auto target = (processCpuSeconds() - liveCpuStarted) * 100 / liveCpuPercent;
73 while (!stopping && std::chrono::duration<double>(Clock::now() - liveStarted).count() < target) {
74 if (resources) resources->checkpoint();
75 std::this_thread::sleep_for(std::chrono::milliseconds(10));
76 }
77 }
78 // Check headroom at the same cooperative boundaries used for cancellation.
79 if (resources && !stopping) resources->checkpoint();
80 return stopping != 0;
81}
82/** @brief Record a stop request without performing cleanup in signal context.
83 * @param sig Signal number; all registered stop signals have the same effect. */
84static void signalHandler(int sig) {
85 (void)sig;
86 stopping = 1;
87}
88/** @brief Resolve the running executable independently of the launch directory.
89 * @return Canonical Linux executable path.
90 * @throws std::filesystem::filesystem_error If procfs resolution fails. */
91static fs::path executablePath() {
92 return fs::canonical("/proc/self/exe");
93}
94/** @brief Locate the default configuration alongside the executable.
95 * @return Candidate path; does not check whether the INI exists. */
96static fs::path defaultIni() { return executablePath().parent_path() / "pangea.ini"; }
97/** @brief Convert a monotonic interval without truncating fractional seconds.
98 * @param duration Clock interval.
99 * @return Interval in seconds. */
100static double seconds(Clock::duration duration) { return std::chrono::duration<double>(duration).count(); }
101/** @brief Create a readable, millisecond-resolution session label.
102 * @return Local wall-clock label, not a uniqueness guarantee. */
103static std::string sessionName() {
104 auto now = std::chrono::system_clock::now();
105 auto tt = std::chrono::system_clock::to_time_t(now);
106 std::tm tm{};
107 localtime_r(&tt, &tm);
108 auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count() % 1000;
109 std::ostringstream text;
110 text << std::setfill('0') << std::setw(4) << (tm.tm_year + 1900) << std::setw(2) << (tm.tm_mon + 1)
111 << std::setw(2) << tm.tm_mday << '_' << std::setw(2) << tm.tm_hour
112 << std::setw(2) << tm.tm_min << std::setw(2) << tm.tm_sec << '_'
113 << std::setw(3) << ms << '_' << getpid();
114 return text.str();
115}
116#include "map_pipeline.h"
117#include "xyz_export.h"
118#include "great_session.h"
119#if SENSORAIA_BUILD_TESTING
120static void require(bool value, const char* message) {
121 if (!value) throw std::runtime_error(std::string("TEST FAILED: ") + message);
122}
123static void testOpenCvParallelBackend() {
124 const int previousThreads = cv::getNumThreads();
125 struct RestoreThreads {
126 int count;
127 ~RestoreThreads() { cv::setNumThreads(count); }
128 } restore{previousThreads};
129
130 constexpr int totalItems = 513;
131 for (const int team : {4, 3}) {
132 cv::setNumThreads(team);
133 require(cv::getNumThreads() == team, "OpenCV parallel backend did not apply thread count");
134 std::vector<std::atomic<int>> hits(totalItems);
135 for (auto& hit : hits) hit.store(0, std::memory_order_relaxed);
136 std::atomic<bool> validThreadIds{true};
137
138 cv::parallel_for_(cv::Range(0, totalItems), [&](const cv::Range& range) {
139 const int tid = cv::getThreadNum();
140 if (tid < 0 || tid >= team) validThreadIds.store(false, std::memory_order_relaxed);
141 int nestedCount = 0;
142 cv::parallel_for_(cv::Range(0, 4), [&](const cv::Range& inner) {
143 nestedCount += inner.size();
144 });
145 if (nestedCount != 4) validThreadIds.store(false, std::memory_order_relaxed);
146 for (int index = range.start; index < range.end; ++index)
147 hits[static_cast<std::size_t>(index)].fetch_add(1, std::memory_order_relaxed);
148 });
149
150 require(validThreadIds.load(std::memory_order_relaxed), "OpenCV parallel backend reported invalid thread index");
151 for (const auto& hit : hits)
152 require(hit.load(std::memory_order_relaxed) == 1, "OpenCV parallel backend missed or duplicated stripe work");
153 if (team == 4) {
154 cv::setNumThreads(1);
155 require(cv::getNumThreads() == 1, "OpenCV parallel backend did not shrink to single thread");
156 }
157 }
158
159 bool caught = false;
160 try {
161 cv::parallel_for_(cv::Range(0, 64), [&](const cv::Range& range) {
162 if (range.start <= 17 && 17 < range.end)
163 throw std::runtime_error("synthetic parallel_for failure");
164 });
165 } catch (const std::exception& error) {
166 caught = std::string(error.what()).find("synthetic parallel_for failure") != std::string::npos;
167 }
168 require(caught, "OpenCV parallel backend lost body exception");
169
170 cv::setNumThreads(1);
171 require(cv::getNumThreads() == 1, "OpenCV parallel backend did not shrink to single thread");
172 std::atomic<bool> serialOnCaller{true};
173 cv::parallel_for_(cv::Range(0, 32), [&](const cv::Range&) {
174 if (cv::getThreadNum() != 0) serialOnCaller.store(false, std::memory_order_relaxed);
175 });
176 require(serialOnCaller.load(std::memory_order_relaxed), "Single-thread OpenCV region used worker thread");
177}
178#include "map_exif_tests.h"
179#include "xyz_tests.h"
180#include "pipeline_tests.h"
181#endif
182
183/** @brief Validate a source session and print its output layout offline.
184 * @param config Requested map and source configuration.
185 * @details For XYZ output, validate the internal render grid separately
186 * from the published tile plan; they need not share pixel dimensions.
187 * @throws std::runtime_error If source admission or layout validation fails. */
188static void checkInputs(const pangea_survey::MapConfig& config) {
189 const auto working = config.outputFormat == "xyz" ? pangea_survey::XyzPlan(config).workingConfig(config) : config;
191 std::cout << "Input valid: " << config.sourceCsv.u8string() << "\nMode: " << config.mode
192 << "; " << checked.columns() << " x " << checked.rows()
193 << (config.outputFormat == "xyz" ? " internal working tiles; " : " map tiles; ")
194 << working.mapPixelSize << " m/working pixel; no MSFS connection.\n";
195 if (config.outputFormat == "xyz") {
196 const pangea_survey::XyzPlan plan(config);
197 std::cout << "XYZ output: " << plan.size() << " complete 256-pixel tiles at zoom "
198 << plan.minZoom << ".." << plan.base.zoom << "; "
199 << pangea_survey::XyzTiles::groundPixel(plan.base.zoom, (plan.north + plan.south) / 2)
200 << " m/ground pixel at area centre.\n";
201 }
202}
203
204int pangeaSurveyMain(int argc, char** argv) {
205 try {
206 if (argc == 2 && (std::strcmp(argv[1], "--version") == 0 || std::strcmp(argv[1], "-v") == 0)) {
207 std::cout << PANGEA_BUILD_VERSION << '\n';
208 return 0;
209 }
210 if (argc == 2 && (std::strcmp(argv[1], "--help") == 0 || std::strcmp(argv[1], "-h") == 0)) {
211 std::cout << "Pangea: completed-survey processing\n"
212 " pangea --check [pangea.ini]\n"
213 " pangea --run [pangea.ini] [--mode simple|great]\n"
214 " pangea --diagnostic [pangea.ini] [--mode simple|great]\n"
215 " pangea --update-great pangea.ini\n"
216 " pangea --follow-great pangea.ini\n"
217 " pangea --finalize-great pangea.ini\n"
218 " pangea --stop\n"
219#if SENSORAIA_BUILD_TESTING
220 " pangea --self-test\n"
221#endif
222 " pangea --version\n";
223 return 0;
224 }
225 if (argc == 2 && std::strcmp(argv[1], "--self-test") == 0) {
226#if SENSORAIA_BUILD_TESTING
227 testOpenCvParallelBackend();
228 testSurveyTiming();
231 testXyzGrid();
232 testMapExif();
233 testSplitPipeline();
234 return 0;
235#else
236 throw std::runtime_error("Self-tests require the private development checkout and BUILD_TESTING=ON");
237#endif
238 }
239 const std::string lockPath = "/tmp/pangea-survey-" + std::to_string(getuid()) + ".lock";
240 if (argc == 2 && std::strcmp(argv[1], "--stop") == 0) {
241 std::ifstream lockFile(lockPath);
242 pid_t pid = 0;
243 if (lockFile >> pid && pid > 1) {
244 const auto process = fs::path("/proc") / std::to_string(pid);
245 std::ifstream arguments(process / "cmdline", std::ios::binary);
246 std::string program, command;
247 std::getline(arguments, program, '\0'); std::getline(arguments, command, '\0');
248 std::error_code error;
249 const auto executable = fs::canonical(process / "exe", error);
250 if (!error && executable == executablePath() &&
251 (command == "--run" || command == "--diagnostic" || command == "--update-great" ||
252 command == "--follow-great" || command == "--finalize-great") &&
253 kill(pid, SIGTERM) == 0) {
254 std::cout << "Stopped Pangea survey PID " << pid << ".\n";
255 return 0;
256 }
257 }
258 std::cerr << "No Pangea survey is running.\n";
259 return 1;
260 }
261 if (argc == 3 && (std::strcmp(argv[1], "--update-great") == 0 ||
262 std::strcmp(argv[1], "--follow-great") == 0 ||
263 std::strcmp(argv[1], "--finalize-great") == 0)) {
264 const auto ini = fs::path(argv[2]);
265 const auto config = pangea_survey::loadMapConfig(ini);
267 resources = std::make_unique<pangea_survey::MapResources>(config);
268 signal(SIGINT, signalHandler);
269 signal(SIGTERM, signalHandler);
270 activePauseFile = config.livePauseFile;
271 liveCpuPercent = config.liveCpuPercent;
273 liveStarted = Clock::now();
274 const bool follow = std::strcmp(argv[1], "--follow-great") == 0;
275 const bool finalize = std::strcmp(argv[1], "--finalize-great") == 0;
276 auto updated = Clock::now() - std::chrono::seconds(config.liveUpdateSeconds);
277 std::string previous;
278 std::string prepared;
279 bool pressureReported = false;
280 do {
281 try {
282 if (isStopping()) break;
283 const bool final = finalize || (!config.liveFinalFile.empty() && fs::exists(config.liveFinalFile));
284 auto snapshot = pangea_survey::greatInputText(config);
285 const auto end = snapshot.rfind('\n');
286 if (end != std::string::npos) snapshot.resize(end + 1);
287 const auto added = std::count(snapshot.begin(), snapshot.end(), '\n') -
288 std::count(previous.begin(), previous.end(), '\n');
289 if (follow && !final && snapshot != prepared &&
290 pangea_survey::updateGreatSession(config, ini, false, false)) prepared = snapshot;
291 if (!follow || final || (snapshot != previous &&
292 (added >= config.liveBatchPhotos || Clock::now() - updated >= std::chrono::seconds(config.liveUpdateSeconds)))) {
293 if (pangea_survey::updateGreatSession(config, ini, final)) {
294 previous = snapshot;
295 updated = Clock::now();
296 } else if (final) throw std::runtime_error("Cannot finalize an empty photo session");
297 }
298 if (!follow || final) return 0;
299 pressureReported = false;
301 if (!follow) throw;
302 if (!pressureReported) std::cout << error.what() << "; waiting for headroom.\n";
303 pressureReported = true;
304 }
305 std::this_thread::sleep_for(std::chrono::milliseconds(250));
306 } while (!stopping);
307 std::cout << "GREAT session stopped; previous revision and working checkpoints retained.\n";
308 return 0;
309 }
310 const bool run = argc >= 2 && std::strcmp(argv[1], "--run") == 0;
311 const bool check = argc >= 2 && std::strcmp(argv[1], "--check") == 0;
312 const bool diagnostic = argc >= 2 && std::strcmp(argv[1], "--diagnostic") == 0;
313 if ((run || check || diagnostic) && (argc == 2 || argc == 3 || argc == 5)) {
314 if (argc == 5 && std::strcmp(argv[3], "--mode") != 0) throw std::runtime_error("Expected --mode");
315 const auto iniPath = argc >= 3 ? fs::path(argv[2]) : defaultIni();
316 const std::string modeOverride = argc == 5 ? argv[4] : "";
317 auto config = pangea_survey::loadMapConfig(iniPath, modeOverride);
318 if (!config.photoDirectory.empty())
319 throw std::runtime_error("AI Camera directories use --update-great, --follow-great or --finalize-great");
320 if (!check) resources = std::make_unique<pangea_survey::MapResources>(config);
321 checkInputs(config);
322 if (check) return 0;
323 int lockFd = open(lockPath.c_str(), O_CREAT | O_RDWR | O_CLOEXEC, 0600);
324 if (lockFd < 0 || flock(lockFd, LOCK_EX | LOCK_NB) != 0) {
325 if (lockFd >= 0) close(lockFd);
326 throw std::runtime_error("Pangea survey already running");
327 }
328 const auto liveLockPath = "/tmp/usher-pangea-" + std::to_string(getuid()) + ".lock";
329 // The live worker has its own lock; taking both prevents offline mapping from competing with capture.
330 const int liveLock = open(liveLockPath.c_str(), O_CREAT | O_RDWR | O_NOFOLLOW | O_CLOEXEC, 0600);
331 if (liveLock < 0 || flock(liveLock, LOCK_EX | LOCK_NB) != 0)
332 throw std::runtime_error("Another Pangea live or survey worker is active; mapping remains optional");
333 if (ftruncate(lockFd, 0) == 0) {
334 std::string pidStr = std::to_string(getpid()) + "\n";
335 ssize_t written = write(lockFd, pidStr.data(), pidStr.size());
336 (void)written;
337 fsync(lockFd);
338 }
339 signal(SIGINT, signalHandler);
340 signal(SIGTERM, signalHandler);
341 if (config.outputFormat == "xyz" && !diagnostic && !config.lowMemory)
342 pangea_survey::XyzPlan(config).checkOutput(config.output);
343 auto workDirectory = config.outputFormat == "xyz" ?
344 config.output.parent_path() / "pangea_exports" / ("xyz_" + sessionName()) : config.output;
345 if (config.lowMemory) {
346 if (diagnostic) throw std::runtime_error("Low-memory profile publishes strict XYZ; use --run");
347 const auto output = fs::weakly_canonical(fs::absolute(config.output)).generic_string();
348 const auto key = pangea_survey::dataDigest(output.data(), output.size());
349 const auto jobName = "xyz_low_memory_" + key.substr(0, 16);
350 workDirectory = config.output.parent_path() / "pangea_exports" / jobName;
351 const auto ini = argc >= 3 ? fs::path(argv[2]) : defaultIni();
352 const auto fingerprint =
353 pangea_survey::fileDigest(ini) + "\n" + pangea_survey::fileDigest(config.sourceCsv) + "\n" +
354 (config.captureManifest.empty() ? "none" : pangea_survey::fileDigest(config.captureManifest)) + "\n" +
355 fs::canonical(config.sourceCsv).generic_string() + "\n" + output + "\n" + config.mode + "\n";
356 const auto identity = std::string("PANGEA_LOW_MEMORY_V1\n") + fingerprint;
357 const auto record = workDirectory / "identity";
358 // Reusing tiles is safe only when inputs, geographic bounds, and mode are identical.
359 if (fs::exists(workDirectory)) {
360 std::ifstream input(record);
361 const std::string saved((std::istreambuf_iterator<char>(input)), std::istreambuf_iterator<char>());
362 if (!input || saved != identity)
363 throw std::runtime_error("Working job identity changed; choose a new output directory");
364 } else {
365 pangea_survey::XyzPlan(config).checkOutput(config.output);
366 fs::create_directories(workDirectory);
368 }
369 config.workingDirectory = workDirectory;
370 }
371 fs::create_directories(workDirectory);
372 SessionLog log(workDirectory, "pangea.log");
373 config.originalSourceCsv = config.sourceCsv;
374 if (!config.lowMemory) config.sourceCsv = pangea_survey::Orthorectifier::normalizeSources(config.sourceCsv,
375 workDirectory / ("rectified_" + sessionName()), isStopping, config.mosaicThreads,
376 static_cast<unsigned>(config.mosaicPhotoCacheMiB));
377 int result = config.outputFormat == "xyz" ? exportXyzTiles(config, config.sourceCsv, workDirectory, diagnostic) :
378 orthorectify(config, config.sourceCsv, diagnostic);
379 close(lockFd);
380 close(liveLock);
381 unlink(lockPath.c_str());
382 return result;
383 }
384 std::cout << "Pangea: completed-survey processing\n"
385 " pangea --check [pangea.ini]\n"
386 " pangea --run [pangea.ini] [--mode simple|great]\n"
387 " pangea --diagnostic [pangea.ini] [--mode simple|great]\n"
388 " pangea --update-great pangea.ini\n"
389 " pangea --follow-great pangea.ini\n"
390 " pangea --finalize-great pangea.ini\n"
391 " pangea --stop\n"
392#if SENSORAIA_BUILD_TESTING
393 " pangea --self-test\n"
394#endif
395 ;
396 return argc == 1 ? 0 : 2;
397 } catch (const std::exception& error) {
398 std::cerr << "ERROR: " << error.what() << '\n';
399 return 1;
400 }
401}
Shared logging and operating-system checks for the survey executable.
void(* close)(struct usbfs_handle *)
Definition chdkbridge.c:57
int(* open)(const struct usbfs_device *, struct usbfs_handle *)
Definition chdkbridge.c:56
Mirror stdout and stderr into one session file for a scoped run.
Hold the per-user GREAT and live-PANGEA locks for one session update.
static void selfTest()
Exercise stage progress, monotonic updates, and completion behavior.
Load a fixed-session source set and render its projected tiles/windows.
Definition ortho_map.h:98
static std::filesystem::path normalizeSources(const std::filesystem::path &csv, const std::filesystem::path &directory, const std::function< bool()> &stopped, unsigned workers=1, unsigned memoryMiB=128)
Rectify JPEG sources into working JPEGs and write a new CSV.
static void selfTest()
Run synthetic orthorectification regression cases.
static double groundPixel(int zoom, double latitude)
Ground metres per pixel at a latitude after Mercator scale correction.
Definition xyz_tiles.h:71
static int record(const union dc_shot_union *shot)
Retrieve a point and admit a new observation only when its credit is free.
static bool stopping
static bool range(size_t total, size_t offset, size_t length)
Check a byte span without forming a potentially overflowing end offset.
Definition exifite.c:133
Coordinate append-only, restartable GREAT XYZ survey sessions.
Encode BGRA map pixels and publish JPEGs with optional EXIF.
struct jpeg_error_mgr error
Definition lwir_image.c:60
Own the survey mapper's validated configuration and mode defaults.
Add projection, coverage, and source provenance to map EXIF.
Orchestrate orthophoto rendering, evidence, and final publication.
static int orthorectify(const pangea_survey::MapConfig &config, const fs::path &csv, bool diagnostic=false, pangea_survey::MapProgress *progress=nullptr, double first=0)
Render orthophoto tiles and publish their coverage/provenance manifest.
Report monotonic progress, stage timings, and explicit interruption.
Apply and periodically check the survey process's low-memory policy.
Write georeferencing sidecars for rendered Pangea map images.
void require(bool valid, const char *message)
Route a failed precondition to the CLI's diagnostic handler.
MapConfig loadMapConfig(const std::filesystem::path &path, const std::string &modeOverride={})
Load and validate a survey INI plus its capture manifest or source CSV.
Definition map_config.h:128
static bool updateGreatSession(const MapConfig &settings, const fs::path &ini, bool final, bool render=true)
Admit new photos and optionally publish a GREAT preview/final revision.
std::string fileDigest(const std::filesystem::path &path, const std::function< bool()> &stopped={})
Hash a file in bounded chunks, optionally honoring cancellation.
Definition map_storage.h:89
std::string greatInputText(const MapConfig &config)
Snapshot the current accepted photo list for one GREAT revision.
std::string dataDigest(const void *data, std::size_t size)
Compute a lowercase SHA-256 digest for an in-memory byte range.
Definition map_storage.h:77
void saveWorkingText(const std::filesystem::path &target, const std::string &text)
Save checkpoint text through the durable working-file publisher.
static bool checked(OrtStatus *status, char *error, size_t capacity)
Consume every ORT error object exactly once while copying its diagnostic before release.
Describe the validated photo set and render projected map windows.
static size_t count
Definition pose_log.c:79
static FILE * output
Definition pose_log.c:77
#define PANGEA_BUILD_VERSION
Definition version.h:76
Fully parsed settings shared by orthomap and XYZ export.
Definition map_config.h:41
std::filesystem::path sourceCsv
Definition map_config.h:71
Derive requested XYZ bounds, map grid, and per-zoom tile ranges.
Definition xyz_tiles.h:119
void checkOutput(const std::filesystem::path &root) const
Reject any existing tile or partial file in the output plan.
Definition xyz_tiles.h:189
MapConfig workingConfig(const MapConfig &original) const
Derive the padded UTM working-grid settings needed for resampling.
Definition xyz_tiles.h:171
static double processCpuSeconds()
Read cumulative CPU time across the mapping process's threads.
Definition survey.cpp:58
std::chrono::steady_clock Clock
Definition survey.cpp:46
static int liveCpuPercent
Definition survey.cpp:52
static std::unique_ptr< pangea_survey::MapResources > resources
Definition survey.cpp:50
static double liveCpuStarted
Definition survey.cpp:53
static fs::path executablePath()
Resolve the running executable independently of the launch directory.
Definition survey.cpp:91
static bool isStopping()
Check cancellation at a cooperative mapping boundary.
Definition survey.cpp:68
static fs::path activePauseFile
Definition survey.cpp:51
int pangeaSurveyMain(int argc, char **argv)
Definition survey.cpp:204
static fs::path defaultIni()
Locate the default configuration alongside the executable.
Definition survey.cpp:96
static void checkInputs(const pangea_survey::MapConfig &config)
Validate a source session and print its output layout offline.
Definition survey.cpp:188
static std::string sessionName()
Create a readable, millisecond-resolution session label.
Definition survey.cpp:103
static Clock::time_point liveStarted
Definition survey.cpp:54
static double seconds(Clock::duration duration)
Convert a monotonic interval without truncating fractional seconds.
Definition survey.cpp:100
static void signalHandler(int sig)
Record a stop request without performing cleanup in signal context.
Definition survey.cpp:84
struct usher_control_result result
Definition usher.c:377
Resample the UTM source mosaic into complete 256-pixel XYZ tiles.
static int exportXyzTiles(const pangea_survey::MapConfig &config, const fs::path &csv, const fs::path &workDirectory, bool diagnostic=false)
Render and publish the planned XYZ pyramid, optionally as diagnostics.
Definition xyz_export.h:230