Loading...
Searching...
No Matches
map_config.h
Go to the documentation of this file.
128inline MapConfig loadMapConfig(const std::filesystem::path& path, const std::string& modeOverride = {}) {
131 "input.photo_directory", "input.camera_profile", "input.max_pose_uncertainty_m", "input.pose_policy",
135 "mosaic.seam_method", "mosaic.seam_scale", "mosaic.blend_bands", "mosaic.exposure_compensation",
140 "live.update_seconds", "live.batch_photos", "live.cpu_percent", "live.pause_file", "live.final_file",
142 "output.directory", "output.jpeg_quality", "output.format", "tiles.zoom", "tiles.min_zoom", "tiles.complete_only",
151 config.lowMemory = profile == "low_memory" || (profile == "auto" && pages > 0 && pageSize > 0 &&
164 if (config.outputFormat == "xyz" && (ini.has("map.pixel_size_m") || ini.has("map.tile_width") ||
166 throw std::runtime_error("XYZ grid uses tiles.zoom and fixed 256-pixel tiles; remove map grid settings");
170 throw std::runtime_error("Specify exactly one input.capture_manifest, input.source_csv or input.photo_directory");
174 manifest.validate({"capture.schema", "capture.status", "capture.source_csv", "capture.planned", "capture.saved",
194 if (saved == 0 || (planned != 0 && (saved > planned || (status == "complete" && saved != planned))))
198 if (csv.empty() || csv.has_parent_path()) throw std::runtime_error("Manifest CSV must be a local filename");
200 config.start = {manifest.required("start.lat"), manifest.required("start.lon"), manifest.required("start.agl")};
201 config.end = {manifest.required("end.lat"), manifest.required("end.lon"), manifest.required("end.agl")};
212 throw std::runtime_error("Recorded-pose input cannot certify max_pose_uncertainty_m; use exposure policy for that gate");
213 if (!std::filesystem::is_directory(config.photoDirectory) || !std::filesystem::is_regular_file(config.cameraProfile))
214 throw std::runtime_error("AI Camera input requires an existing photo_directory and camera_profile");
218 const bool bounds = ini.has("start.lat") || ini.has("start.lon") || ini.has("end.lat") || ini.has("end.lon");
234 if (value != std::floor(value)) throw std::runtime_error(std::string(key) + " must be integer");
240 config.xyzMinZoom = integer("tiles.min_zoom", config.xyzZoom, std::max(0, config.xyzZoom - 2), config.xyzZoom);
251 config.mosaicOverviewPixels = integer("mosaic.overview_pixels", config.mosaicOverviewPixels, 250000, 8000000);
254 config.mosaicOverviewSourceMaxSide = integer("mosaic.overview_source_max_side", config.mosaicOverviewSourceMaxSide, 64, 2048);
259 if (config.mosaicSeamMethod != "graphcut" && config.mosaicSeamMethod != "dp" && config.mosaicSeamMethod != "voronoi")
261 config.mosaicThreads = static_cast<unsigned>(integer("mosaic.threads", static_cast<int>(config.mosaicThreads), 1, 32));
265 config.minCoverage = ini.numeric("quality.min_colour_coverage", config.outputFormat == "xyz" ? 1 : .999);
276 if (ini.has("live.pause_file")) config.livePauseFile = base / configPath(ini.text("live.pause_file"));
277 if (ini.has("live.final_file")) config.liveFinalFile = base / configPath(ini.text("live.final_file"));
282 throw std::runtime_error("Low-memory profile requires Great XYZ with graphcut seams, gap filling, "
284 if (!config.photoDirectory.empty() && (!config.lowMemory || config.mode != "great" || config.outputFormat != "xyz" ||
286 throw std::runtime_error("AI Camera photos require low_memory GREAT XYZ and mosaic.reference_plane_amsl_m in FC navigation datum");
Read scalar values from a bounded, section-based INI file.
Definition ini_file.h:38
static bool bounds(const struct coverage_state *state, const struct coverage_candidate *candidate, struct coverage_bounds *box)
Reject unusable polygons before converting coordinates or scanning cells.
Definition coverage_scheduler.c:120
Parse strict section-qualified INI settings for the survey mapper.
Definition camera_optics.h:32
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
std::filesystem::path configPath(std::string text)
Normalize INI paths to the host filesystem's UTF-8 path parser.
Definition map_config.h:113
void range(double value, double minimum, double maximum, const std::string &name)
Enforce the inclusive policy bounds for a parsed setting.
Definition route.h:160
bool mosaicMode(const std::string &mode)
Return whether a supported processing mode uses the Great mosaic.
Definition map_config.h:80
std::string mosaicRenderMethod(const std::string &method)
Give a stable descriptive name to a Great seam-and-blend renderer.
Definition map_config.h:108
void mapMode(MapConfig &config, const std::string &mode)
Select one of the two supported processing modes and apply its defaults.
Definition map_config.h:91
Fully parsed settings shared by orthomap and XYZ export.
Definition map_config.h:41
std::filesystem::path workingDirectory
Definition map_config.h:57
std::filesystem::path preparedSourceDirectory
Definition map_config.h:58
std::filesystem::path livePauseFile
Definition map_config.h:65
std::filesystem::path originalSourceCsv
Definition map_config.h:71
std::filesystem::path cameraProfile
Definition map_config.h:60
std::filesystem::path sourceDirectory
Definition map_config.h:59
std::optional< std::size_t > expectedSaved
Definition map_config.h:72
std::filesystem::path weatherReadback
Definition map_config.h:76
std::optional< UtcDateTime > startupUtc
Definition map_config.h:74
std::filesystem::path liveFinalFile
Definition map_config.h:65
std::filesystem::path photoDirectory
Definition map_config.h:60
std::filesystem::path captureManifest
Definition map_config.h:71
int mosaicOverviewSourceMaxSide
Definition map_config.h:53
Geographic route point; latitude/longitude are degrees and AGL is metres.
Definition route.h:48