Repository navigation
fix(analysis): measure radius searches on the ground near a pole, and meet at the poles (#1033) #1349
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
base: main
Are you sure you want to change the base?
fix(analysis): measure radius searches on the ground near a pole, and meet at the poles (#1033) #1349
Changes from all commits
f260ed7
cadf4f3
eebf4af
2f028aa
3d6b8d0
2df1d2a
5095543
f5f83a5
90c7056
91b595d
b6bed61
bfee5d3
b885b7c
194bae1
42daf15
f71ea65
6ea27d3
9a3b6af
60a6cde
99dafca
ababb90
a3f8c2e
bb4fa0e
bc9e6c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1289,8 +1289,11 @@ fn topology_validate(s: &mut Session, p: &Json) -> CmdResult { | |
| use rustgis_analysis::topology as t; | ||
| let tol = f(p, "toleranceM").unwrap_or(1.0).clamp(0.0, 10_000.0); | ||
| let mut errors = Vec::new(); | ||
| // Rules whose check stopped early (an error or work limit): their counts are partial. | ||
| // Rules whose check stopped early (an error or work limit), or measured some part more coarsely | ||
| // than it's meant to (a line winding round a pole many times): their counts may be off. | ||
| let mut incomplete = Vec::new(); | ||
| // Polygons a check had to leave out, by rule. | ||
| let mut skipped = Vec::new(); | ||
| for rule in s.map().editing.topology.clone() { | ||
| let Some(l) = s.map().layer_by_name(rule.layer()) else { continue }; | ||
| let rows: Vec<usize> = l.visible_rows().iter().enumerate().filter(|(_, v)| **v).map(|(i, _)| i).collect(); | ||
|
|
@@ -1307,6 +1310,14 @@ fn topology_validate(s: &mut Session, p: &Json) -> CmdResult { | |
| if !found.complete { | ||
| incomplete.push(rule.label().to_string()); | ||
| } | ||
| if found.skipped > 0 { | ||
| // The features left out are the covering layer's. | ||
| let of = match &rule { | ||
| TopologyRule::MustBeCoveredBy { by, .. } => by.as_str(), | ||
| _ => l.name.as_str(), | ||
| }; | ||
| skipped.push(format!("{} on '{}': {} feature(s) of '{}'", rule.label(), l.name, found.skipped, of)); | ||
| } | ||
| errors.extend(found.errors.into_iter().map(|e| crate::TopologyIssue { | ||
| rule: rule.label().to_string(), | ||
| layer: l.name.clone(), | ||
|
|
@@ -1315,6 +1326,18 @@ fn topology_validate(s: &mut Session, p: &Json) -> CmdResult { | |
| lat: e.at.y, | ||
| })); | ||
| } | ||
| if !incomplete.is_empty() { | ||
| s.warn(format!( | ||
| "Checks that stopped early (an error or work limit) or measured a line round a pole coarsely, so their counts may be off: {}", | ||
| incomplete.join(", ") | ||
| )); | ||
| } | ||
| if !skipped.is_empty() { | ||
| s.warn(format!( | ||
| "Polygons left out of the check at a pole (a coordinate missing or infinite, or a million turns around), so its result there may be wrong: {}", | ||
| skipped.join("; ") | ||
| )); | ||
|
Comment on lines
+1335
to
+1339
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.
|
||
| } | ||
| let n = errors.len(); | ||
| let out: Vec<Json> = | ||
| errors.iter().take(1000).map(|e| json!({"rule": e.rule, "layer": e.layer, "rows": e.rows, "lon": e.lon, "lat": e.lat})).collect(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent result (Never silent). A rule whose check is
incompleteis reported only in the returned JSON ("incomplete": incomplete, a few lines below). The new coarse path indangles(a line winding round a pole pastPOLAR_PIECES_MAX) reaches it, and so do the existing work-limit partials. The Error Inspector ignores the return value (ribbon.rsuseslet _ =), so the user gets no notice. Only theskippedcase here callss.warn.Suggest one notice for
incomplete, placed before thisskippedblock:Confidence: medium-high. I haven't seen the Error Inspector render, so please confirm the JSON isn't shown elsewhere. Add an engine test that asserts the notice for a coarse dangle check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a3f8c2e: Validate Topology now warns, naming the rules whose checks stopped early (an error or work limit) or measured a line round a pole coarsely, so their counts may be off.
validate_topology_says_which_checks_are_incompletechecks a line winding round the North Pole gives the warning and a plain line doesn't.