Repository navigation
Edits, paste, topology and offline sync with a feature that has no longitude/latitude place (#2032 C2f-4b-1c) - #2842
Conversation
…where in it; shortest_route_held takes the layer; data.md names when the direct operation draws; a stale comment (opengeos#2032 C2f-8, C2f-4b-1b, C2f-5)
… can't be given in longitude/latitude, or name it (opengeos#2032 C2f-4b-1c)
…t a feature out is said to be incomplete; topology issues answer located; Field Package return documented (opengeos#2032 C2f-4b-1c)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| /// [`Dataset::geometry_to_lonlat`] of `g`, feature `id`'s geometry, for an edit of that one | ||
| /// feature: refused naming the layer and the feature when one of its places can't be given in | ||
| /// longitude/latitude, so it can't be edited there. | ||
| pub fn feature_to_lonlat<'a>(&self, id: u64, g: &'a Geometry) -> std::result::Result<Cow<'a, Geometry>, String> { |
There was a problem hiding this comment.
feature_to_lonlat names self.name, the dataset's name, in its refusal. The file already notes that a layer's map name can differ from its data's name after a name clash (the named closure in check_topology, and the sync path using own.name), and the PR's own topology test is written around that. This error can therefore name a different layer than the one the user sees on the map.
Suggested fix: take the map layer name as a parameter from the callers (they already have l.name), or document in the doc comment that the name is the data's name so callers that know the map name can replace it.
Category: quality
| let mut keep = placed.into_iter(); | ||
| src.features.retain_rows(|_| keep.next().unwrap_or(true)); | ||
| if src.features.is_empty() { | ||
| return Err(format!("Paste: the copied feature(s) have a place {} ({}) can't hold", l.name, own.label())); |
There was a problem hiding this comment.
The wording reads as if the layer's name were a place: "the copied feature(s) have a place plain (Robinson) can't hold". Make the layer the subject, as the notice below does: "Paste: the copied feature(s) have a place that layer {} ({}) can't hold".
Category: quality
| /// command line call commands one at a time on the session and use each answer before the next, | ||
| /// so they check where they ask, with the work limit of a run that can't be cancelled. A registered | ||
| /// window owner refuses an unprepared nonempty check instead of computing it inline. | ||
| /// One issue as `topology.validate` answers it. `located` is false for an issue at a place that |
There was a problem hiding this comment.
This inserted block splits the doc comment of topology_validate. Its description ("Checks every topology rule; the errors are kept for the Error Inspector…", lines 2727–2734) now sits above issue_json, and topology_validate loses its doc.
Suggested fix: move this issue_json block (its two doc lines and the fn) above the Checks every topology rule comment, so that comment stays with topology_validate.
Category: quality
Code reviewI reviewed the whole PR diff, the base-branch AGENTS.md, and the surrounding code for the routing build ( BugsNone confirmed. I checked the paste conversion ordering and row bookkeeping, the Move/Flip/Split/Cut paths, the route build (which converts each line as it reads it), the offline-sync refusal and write-back, and the topology NaN handling. The SecurityNone found. PerformanceNone found. The conversion is now done once per layer instead of once per feature in the edit paths. Sync holds the same number of full copies as before. Quality
AGENTS.mdNo breaks found. The new refusals and notices are one per kind with counts, the Cancel and background paths are unchanged, and no command was added or renamed. Questions I did not post
Change sizeCompared with the base branch (merge base 182a8e9 to PR head f845bf2). The stats were not truncated.
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Part of #2032 C2f-4b-1, after #2778 (C2f-4b-1a) and #2798 (C2f-4b-1b). A layer held in its own system can have a feature with a place that can't be given in longitude/latitude: one far past where its system reaches. This PR covers edits, paste, topology and offline sync.
Before: one such feature in the selection, the layer or the source failed the whole edit, check or sync.
Now: an edit of many features leaves it as it is and says how many; an edit of that one feature is refused naming it. A layer whose places all convert says nothing new, so its results are unchanged.
Dataset::feature_to_lonlatgives "{layer}: feature {id} has a place in {system} that can't be given in longitude/latitude, so it can't be edited there". Set Geometry and Delete still work on it, so it can be given a new shape or removed.topology.validate):located: falsewith nulllon/lat, the Error Inspector selects its features without zooming, and a notice counts these issues. Before, the whole check was refused.offline.sync, and a field package that goes back as a whole map): a source feature with such a place outside the area stays as stored (merged_from_lonlattakes it as the source holds it). Before, one such feature anywhere in the source layer refused every sync of every area. One the area holds can't be compared with the area's copy, and still refuses the sync, now naming it.Deliberately unchanged:
Also from earlier threads:
planetary::proj4_axesreads the whole PROJ definition, not its first 64 words, with a test of a late+a(Go To XY and Fit To Map View in the map's own system (#2032 C2f-8) #2786 thread).navigate.rs(Go To XY and Fit To Map View in the map's own system (#2032 C2f-8) #2786 thread).network::shortest_route_heldtakes the layer; its closure had become a no-op (Geoprocessing reads a feature it can't place in longitude/latitude without its geometry, and says so (#2032 C2f-4b-1b) #2798 thread).Memory
No new copies.
Reach
edit.move,edit.rotate,edit.scale,edit.flip,edit.split,edit.cutPolygon,edit.vertex,edit.reshape,edit.trace,edit.merge, shape conversion,edit.paste,topology.validate,offline.syncand the whole-map field package return.topology.validate's issues gainlocated.Testing
crates/engine/src/tests/unplaced_edits.rs, 6 tests, on layers held in Robinson (and one in UTM) withFAR = (1e12, 1e12):located: false.held_layers.rs:a_sync_leaves_a_source_feature_it_cant_place_as_stored, which fails without the fix ("cannot sync layer 'Wells': … feature 10 … can't be given in longitude/latitude"), and the refusal naming a feature the area holds.design.rs: the topology test that pinned the old refusal now pins the new behaviour, with layers named as the map has them.-D warnings, fmt, the engine suite,cargo xtask rows, schema and the wasm build as CI runs it pass. Five reader tests (four inrustgis-data, and the engine's GDAL reload test) fail locally on this machine, as they did for Geoprocessing reads a feature it can't place in longitude/latitude without its geometry, and says so (#2032 C2f-4b-1b) #2798; this PR changes none of the readers they test.locatedmarker;All are fixed here.
Summary by CodeRabbit
Bug Fixes
Documentation