Skip to content
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

Cut away from area ---> Cut away from all selected areas #2218

Open
ollesmaps opened this issue Apr 8, 2024 · 13 comments
Open

Cut away from area ---> Cut away from all selected areas #2218

ollesmaps opened this issue Apr 8, 2024 · 13 comments

Comments

@ollesmaps
Copy link

Actual behaviour

At this moment the Cut away from area tool works only for two selected areas.

Expected behaviour

It would be great if it worked for all selected areas.

Benefits

This would greatly enhance legibility checking.
At this moment different screens of green, yellow can be over each other and you do not really see their real size.
By applying the tool Cut away from all selected areas you would get real sizes and could check more easily if minimum area sizes are kept.

@krticka
Copy link
Contributor

krticka commented Apr 8, 2024

This should be connected with more sophisticated querying for lengths and areas. For example SYMBOL 403 < 225.

= is equal to
<> is not equal to
> is greater than
>= is greater than or equal to
< is less than
<= is less than or equal to

@lpechacek
Copy link
Member

Thanks for the suggestion, Aleš!

At this moment the Cut away from area tool works only for two selected areas.

Not really. It is possible to select multiple objects. The Cut away from area tool then takes the first object and subtracts the later selected objects from it. Please mind that the order of object selection is important, I'll refer to that later.

It would be great if it worked for all selected areas.

The order of object selection matters. There is a difference between subtracting thickets from a clearing area and subtracting clearing area from the one of the thicket. In the first case, thickets will be left intact and the clearing will be modified, in the latter it's reversed.

That means that the program will have to decide what to cut away from what, i.e. the order of cutting. I guess that it's clear that it should be in the order of color layering from the bottom to the top to maintain the map appearance. But we've got combined symbol which render with multiple colors. I acknowledge that it's a rare case but I'm advocating for the principle of least surprise at this point. Maybe the new tool should work only with plain area symbols and nothing else.

This would greatly enhance legibility checking. At this moment different screens of green, yellow can be over each other and you do not really see their real size. By applying the tool Cut away from all selected areas you would get real sizes and could check more easily if minimum area sizes are kept.

Understood. The tool would in fact enforce the "polygons must not overlap" rule (common in the GIS world) onto the map while maintaining its appearance. I can imagine that some map makers would be unhappy for this feature as they use overlaps to cheat the OCAD legibility tool.

Overall, I like the idea and I think that it's a whole new tool rather than an enhancement to the existing tool. I believe that its implementation will be a rewarding adventure to whoever picks that challenge.

FTR, draft algorithm as it comes to my mind at the moment:

  1. make sure that only plain areas are selected (unless we invent how to safely cut combined symbol areas)
  2. sort the selected objects (areas) by their color order from the bottom to the top
  3. for all objects cut away the colliding objects further in the sorted list
    (mind that the current "cut away" tool implementation creates artifacts when applied on areas that touch but don't overlap)
    3.1) if the object was modified, put its old version into an undo step

@dg0yt
Copy link
Member

dg0yt commented Apr 8, 2024

I think what is really needed in many cases is a "shared boundary" which can be moved easily in future map revisions.

@jmacura
Copy link
Contributor

jmacura commented Apr 8, 2024

I think what is really needed in many cases is a "shared boundary" which can be moved easily in future map revisions.

Topology constraints FTW?

@jjojala
Copy link
Contributor

jjojala commented Apr 8, 2024

See also #2211 and #1021

According #2211 the query expression could be e.g. SYMBOL 403 AND $area < 225 or SYMBOL 507 AND $length < 5.3

@ollesmaps
Copy link
Author

Thank you @lpechacek for the explainer. I did not realize the order of object selection is crucial.
In that way it makes sense to make a completely new tool as you suggested based on the colour order.

And yes it would be a great tool to identify "accidental" overlaps :)

@ollesmaps
Copy link
Author

The Cut away from area tool then takes the first object and subtracts the later selected objects from it. Please mind that the order of object selection is important, I'll refer to that later.

I tried that in the app - there the order of object selection has no effect.

@lpechacek
Copy link
Member

The Cut away from area tool then takes the first object and subtracts the later selected objects from it. Please mind that the order of object selection is important, I'll refer to that later.

I tried that in the app - there the order of object selection has no effect.

Ummm, I'm not sure what you mean. I mean with the "order of object selection" that it matters which object is selected first. That is the one which gets modified. The other objects (second and further) can follow in arbitrary order. I.e. the order of selection of the second and further objects has "no effect".

@ollesmaps
Copy link
Author

Maybe I am just unaware how to select objects one by one. And I am talking about the current behaviour in the app.
There I can select objects only "all at once".
Or is there a way how to mimic desktop Shift-Left-Click to select objects in specific order?
@lpechacek

@dg0yt
Copy link
Member

dg0yt commented Apr 21, 2024

By "app", you refer to the Android version?

@ollesmaps
Copy link
Author

By "app", you refer to the Android version?

Yes, sorry! Exactly Android.

@lpechacek
Copy link
Member

lpechacek commented Apr 23, 2024

Thanks, @dg0yt , for taking the discussion back on track. :)

Maybe I am just unaware how to select objects one by one. And I am talking about the current behaviour in the app. There I can select objects only "all at once".

Yes, there are two possibilities for object selection in Mapper.

  1. Click to select. This has a special algorithm to cycle through available objects when the cursor is motionless during clicking (common with mouse). As the touch point moves on touchscreen, it tends to be difficult to cycle through the objects on mobile devices.
  2. Drag to select (in Czech "zatáhnout"). All objects at least partially in the rectangle are selected.

Please mind that both possibilities are available on all platforms (i.e. all desktop and the "app").

[ Specifically, it's possible to connect a mouse to Android device. Either through an USB OTG adapter or via Bluetooth. Then a cursor appears on screen and the app behavior is the same as desktop. ]

Or is there a way how to mimic desktop Shift-Left-Click to select objects in specific order? @lpechacek

Yes. The Snap button ("Přichytit" in the video) serves the same purpose as the Shift keyboard modifier. In the demo below I'm selecting the objects one by one using the "Snap" functionality. HTH

cut.away.-.oomapper.on.android.mp4

@ollesmaps
Copy link
Author

Yes. The Snap button ("Přichytit" in the video) serves the same purpose as the Shift keyboard modifier. In the demo below I'm selecting the objects one by one using the "Snap" functionality.

Ir really works! Thank you Libor for the thorough explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants