Repository navigation
feat(edit): vertex handles from the layer's own coordinates; edits on a map in its system written as placed (C2f-7 part 2) #3018
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
9c8d527
993e11b
f4f60c3
fbdc946
10ca360
1bb7831
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 |
|---|---|---|
|
|
@@ -170,15 +170,20 @@ fn split_and_cut_leave_out_what_they_cant_place() { | |
| assert!(e.contains("can't be given in longitude/latitude, so they can't be cut"), "{e}"); | ||
| } | ||
|
|
||
| /// An edit of the one feature that can't be placed (a vertex, a reshape, a merge with it) is | ||
| /// refused naming the layer and the feature. | ||
| /// An edit of the one feature that can't be placed (a reshape, a merge with it) is refused | ||
| /// naming the layer and the feature. A vertex moved to a place in longitude/latitude is written | ||
| /// in the layer's coordinates, every other vertex as stored (#2032 C2f-7). | ||
| #[test] | ||
| fn an_edit_of_a_feature_it_cant_place_names_it() { | ||
|
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. Nit: the test's name and the first line of its doc still say an edit of this feature is refused, but the vertex part now asserts that a move succeeds and writes only that vertex (the reshape and merge parts still assert refusal). A name such as Category: quality |
||
| let mut s = session(true); | ||
| let id = s.map().layer_by_name("lines").unwrap().dataset.features.row(1).unwrap().id(); | ||
| let named = format!("lines: feature {id} has a place in"); | ||
| let e = s.run("edit.vertex", &json!({"layer": "lines", "row": 1, "action": "move", "index": 0, "lon": 10.0, "lat": 45.0})).unwrap_err(); | ||
| assert!(e.contains(&named) && e.contains("so it can't be edited there"), "{e}"); | ||
| let before = s.map().layer_by_name("lines").unwrap().dataset.features.geometry(1).unwrap().clone(); | ||
| s.run("edit.vertex", &json!({"layer": "lines", "row": 1, "action": "move", "index": 0, "lon": 10.0, "lat": 45.0})).unwrap(); | ||
| let after = s.map().layer_by_name("lines").unwrap().dataset.features.geometry(1).unwrap().clone(); | ||
| let v = rustgis_data::VertexId::new(0, 0, 0); | ||
| assert_ne!(after.vertex(v), before.vertex(v)); | ||
| assert_eq!(after.move_vertex(v, before.vertex(v).unwrap()), Some(before), "only the moved vertex changes"); | ||
| select(&mut s, "lines", &[1]); | ||
| let across = json!({"type": "LineString", "coordinates": [[10.0, 45.0], [10.01, 45.01]]}); | ||
| let e = s.run("edit.reshape", &json!({"line": across})).unwrap_err(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.