Loading...
Searching...
No Matches
map_pipeline.h
Go to the documentation of this file.
41static int orthorectify(const pangea_survey::MapConfig& config, const fs::path& csv, bool diagnostic = false,
45 ownedProgress = std::make_unique<pangea_survey::MapProgress>(diagnostic ? "Diagnostic progress" : "Map progress");
53 std::cout << "Pangea " << config.mode << ": " << processor.columns() << " x " << processor.rows()
61 manifest << "filename,row,column,epsg,center_easting_m,center_northing_m,pixel_size_m,width,height,"
64 const auto incomplete = "{\"complete\":false,\"mode\":" + pangea_survey::PhotoExif::jsonString(config.mode) + "}";
67 progress->stage(diagnostic ? "Rendering diagnostic evidence" : "Creating and saving map tiles", renderStart, 99);
94 geometry << ",\"render_method\":" << pangea_survey::PhotoExif::jsonString(pangea_survey::mosaicRenderMethod(image.seamMethod))
106 const auto sourcesText = "{\"source_csv\":" + pangea_survey::PhotoExif::jsonString(csv.u8string()) +
114 const auto metadata = exif.buildOrtho(image, projection, sourceCompanion.filename().u8string());
119 std::cout << "Diagnostic only: unapproved image/coverage evidence saved; no final tile published.\n";
125 throw std::runtime_error("Map colour coverage is below quality.min_colour_coverage; final JPEG not published. "
126 "Inspect saved coverage evidence; acquire additional source photos or reduce the requested bounds.");
132 const auto metadata = exif.buildOrtho(image, projection, sourceCompanion.filename().u8string());
140 if (error) std::cerr << "WARNING: Cannot clean unpublished orthophoto metadata: " << error.message() << '\n';
144 manifest << path.filename().u8string() << ',' << i / processor.columns() << ',' << i % processor.columns()
163 << ",\"blend\":" << pangea_survey::PhotoExif::jsonString(pangea_survey::mosaicMode(config.mode) ? "multiband" : config.blend)
168 << ",\"mosaic_blend_bands\":" << (pangea_survey::mosaicMode(config.mode) ? config.mosaicBlendBands : 0)
169 << ",\"mosaic_exposure_compensation\":" << (pangea_survey::mosaicMode(config.mode) && config.mosaicExposure ? "true" : "false")
175 << ",\"gap_fill_method\":" << pangea_survey::PhotoExif::jsonString(config.mosaicFillGaps ? "global_source_push_pull" : "none")
177 << ",\"render_method\":" << pangea_survey::PhotoExif::jsonString(pangea_survey::mosaicMode(config.mode) ?
179 << ",\"original_source_csv\":" << pangea_survey::PhotoExif::jsonString(config.originalSourceCsv.u8string())
184 << ",\"output_overlap_pixels\":0,\"source_csv\":" << pangea_survey::PhotoExif::jsonString(csv.u8string())
187 << ",\"requested_weather_preset\":" << pangea_survey::PhotoExif::jsonString(config.weatherPreset)
191 << (config.weatherReadback.empty() ? "null" : pangea_survey::PhotoExif::jsonString(config.weatherReadback.u8string()))
193 << (processor.captureUtc() ? pangea_survey::PhotoExif::jsonString(processor.captureUtc()->text) : "null")
Publish immutable result files without exposing partial contents.
void saveBinary(const fs::path &path, const void *data, std::size_t size)
Write bytes to a new path and publish them by same-directory rename.
Definition binary_output.h:41
static void save(const Image &image, const std::filesystem::path &path, const unsigned char *exif=nullptr, std::size_t exifSize=0, bool durable=false)
Publish encoded JPEG bytes, optionally adding one EXIF APP1 segment.
Definition jpeg_encoder.h:192
Serialize source-camera provenance and map-grid metadata for orthophotos.
Definition map_exif.h:36
static std::string sourceMetadata(const std::vector< OrthoSource > &sources)
Encode each source image's optical, geographic, and timing provenance.
Definition map_exif.h:43
Thread-safe progress reporter for staged map work.
Definition map_progress.h:49
Forward and inverse WGS-84 Transverse Mercator conversion for one UTM zone.
Definition map_projection.h:46
static void writeMap(const fs::path &path, const pangea_survey::MapTile &map, int width, int height, bool orthorectified=false)
Publish a world file and GIS projection metadata for one map image.
Definition map_writer.h:96
Load a fixed-session source set and render its projected tiles/windows.
Definition ortho_map.h:98
std::optional< UtcDateTime > captureUtc() const
Return the validated common capture UTC target, when present.
Definition ortho_map.cpp:469
OrthoImage render(std::size_t index, const std::function< bool()> &stopped, const std::function< void(double)> &progress={})
Render one configured output tile.
Definition ortho_map.cpp:1293
static std::string jsonString(const std::string &text)
Escape a string as a JSON string literal.
Definition photo_exif.h:456
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.
Definition map_pipeline.h:41
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
Fully parsed settings shared by orthomap and XYZ export.
Definition map_config.h:41
std::filesystem::path originalSourceCsv
Definition map_config.h:71
std::filesystem::path weatherReadback
Definition map_config.h:76
std::optional< UtcDateTime > startupUtc
Definition map_config.h:74
int mosaicOverviewSourceMaxSide
Definition map_config.h:53
static bool isStopping()
Check cancellation at a cooperative mapping boundary.
Definition survey.cpp:68
static std::string sessionName()
Create a readable, millisecond-resolution session label.
Definition survey.cpp:103