Repository navigation
fix(engine): release quality sweep (imports, models, tile templates, docs) #1606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
24710dd
15cf627
a09d30a
9fab67a
572632d
12d70d8
060b11f
b0cd9f0
646dadf
1ff58c2
e9d2196
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,13 +148,15 @@ fn add(s: &mut Session, p: &Value) -> CmdResult { | |
| }); | ||
| // Its header read first, so its bands are known; the layer is framed only when it is the | ||
| // map's first content (no "zoom" is passed, so add_cog defaults it to that). In the | ||
| // browser nothing may wait, and it is read as the map draws. | ||
| // browser nothing may wait, nor may a plugin's command in the app (it runs on the | ||
| // frame): it is read as the map draws. | ||
| let probe = cfg!(not(target_arch = "wasm32")) && !s.leave_downloads; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unusable tile is accepted silently on the plugin path. With This matches what the browser already does. The AGENTS.md rule "Unusable results are errors" still applies, though. Suggest either a notice when the background header read later fails, or a note in the command's result that the tile was added unchecked. Confidence: moderate (about 55%). The design choice is deliberate, so this may be a trade-off to confirm rather than a defect.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same trade-off as layer.add on a plugin's command and in the browser: with |
||
| #[cfg(not(target_arch = "wasm32"))] | ||
| if !crate::render::rustgis_tiles::cog::probe_blocking(file)? { | ||
| if probe && !crate::render::rustgis_tiles::cog::probe_blocking(file)? { | ||
| return Err(format!("{file}: not a cloud-optimised GeoTIFF")); | ||
| } | ||
| let look = crate::render::rustgis_tiles::cog::with_look(file, &look); | ||
| super::layer::add_cog(s, &json!({"name": name}), &look, cfg!(not(target_arch = "wasm32"))) | ||
| super::layer::add_cog(s, &json!({"name": name}), &look, probe) | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| } | ||
| "earth-index" => add_points(s, p, name), | ||
| _ => add_tessera(s, p, d, name), | ||
|
|
@@ -313,6 +315,26 @@ mod tests { | |
| assert_eq!(band_label([1, 16, 9]), "2, 17, 10"); | ||
| } | ||
|
|
||
| /// A plugin's command in the app (`leave_downloads`) doesn't read an AlphaEarth tile's header | ||
| /// on the frame: the layer is added and read as the map draws. | ||
| #[cfg(not(target_arch = "wasm32"))] | ||
| #[test] | ||
| fn alphaearth_added_without_waiting_when_downloads_are_left() { | ||
| let url = "https://127.0.0.1:9/annual/2024/10N/x.tiff"; | ||
| let mut s = Session::new(Project::default()); | ||
| s.leave_downloads = true; | ||
| let r = s.run("embeddings.add", &json!({"dataset": "alphaearth", "url": url})); | ||
| assert!(r.is_ok(), "{r:?}"); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| // The tile is added with its AlphaEarth look. | ||
| let tile = s.map().tiles.last().map(|t| t.url.clone()).unwrap_or_default(); | ||
| let (file, look) = crate::render::rustgis_tiles::cog::split(&tile); | ||
| assert_eq!(file, url); | ||
| assert!(look.aef, "{tile}"); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| // Elsewhere its header is read first, so an unreadable tile is refused. | ||
| let mut t = Session::new(Project::default()); | ||
| assert!(t.run("embeddings.add", &json!({"dataset": "alphaearth", "url": url})).is_err()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn points_coloured_by_their_components() { | ||
| let mut s = Session::new(Project::default()); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.