-
Notifications
You must be signed in to change notification settings - Fork 91
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
Keyboard Shortcut idea: cycle through common footway types #1154
Comments
Further idea- we could adjust the tagging on any crossing nodes inside the way as well while cycling. |
Further, even crazier idea- adjust the list of cycle tags depending on geographical area / country. |
This part sounds terrible, but everything else seems fine. |
This is tough. If you select a footway=sidewalk or footway=path then what will happen? So the rule would be if 'footway=crossing' and you press this key then cycle between:
I like it. But maybe there is a chance here to add something where you can define a few hotkeys to set a defined set of tags to a selected footway? For instance, if I know I'm going to be editing crossings I might assign So basically similar to your idea, but make it very generic and extendable for power users. |
Can this be assigned to me? |
Okay @RitaDee! So here's more on the Shift+C Hotkey: https://github.com/facebookmicrosites/Open-Mapping-At-Facebook/wiki#hot-keys Try it yourself on an existing traffic road. It will cycle through a preset bunch of road types, each of which is represented by an openstreetmap 'tag'. Think of 'tags' as bits of metadata that are applied to the entities on the map- they don't affect the geometry of the feature, but they do affect its underlying meaning/representation. Now, try it on a building or a park- you should not see any changes, because buildings and parks are not the correct type of feature for the hotkey to work on. What we want to do is expand the key's functionality. The existing key works something like this: flowchart LR
A[Road Selected] -->B(Type Shift+C);
B --> C{Is the Road Type appropriate?};
C -->|Yes| D[Change its tag according to the preset list];
C -->|No| E[Do nothing];
The preset list is defined in this cycle highway tag [code const array]:(https://github.com/facebook/Rapid/blob/main/modules/operations/cycle_highway_tag.js#L18C3-L25C5) flowchart LR
A[Residential] -->B(Service);
B --> C(Track);
C --> D(Unclassified);
D --> E(Tertiary);
E --> F(no tag);
F --> A;
However! You'll also notice that there is another regular expression defined in line 13: it has a few more tags in it than the preset cycle does. What's that about? Well, that turns out to be the secret sauce for the first flowchart, where we ask 'is the road type appropriate'? The Regex:
means that we allow any of these kinds of roads: motorway, trunk, primary, secondary, tertiary, unclassified, residential, living_street, service, track. BUT! If the road type is in this 'allowed' list, but not the 'cycle preset' list above, we change the road type to the first cycle preset. Hitting shift C repeatedly will only cycle through the existing preset list. Let's update that second chart with what's really actually going on for the cycle presets: flowchart LR
AA[Motorway] --> A;
BB[Trunk] --> A;
CC(primary) --> A;
DD(secondary) --> A;
EE(living_street) --> A;
A[Residential] -->B(Service);
B --> C(Track);
C --> D(Unclassified);
D --> E(Tertiary);
E --> F(<no tag>);
F --> A;
You can select a road that is 'trunk', for example, but you can hit shift+C all you want, you will never get back to seeing the road be 'unclassified' again because it is not in the preset list. |
Update: I have added the 'ladder:skewed' value after discussing further with @atiannicelli So, the above explains how the existing hotkey works. What we want to do in this feature is to extend the hotkey so that it also works for certain crosswalk types. For now, let's do this by adding another flowchart LR
A[Road Selected] -->B(Type Shift+C);
B --> C{Is it a road, or a crosswalk?};
linkStyle 1 color:blue;
C -->|Road| D[Change its tag according to the road preset list];
C -->|Crosswalk| E[Change its tag according to the crosswalk preset list];
style E fill:#333,stroke:#ff26db,stroke-width:4px;
C -->|No| F[Do nothing];
To test 'is it a crosswalk', we just want to see if the way is marked as a crossing, specifically that it has a Here's the crosswalk Preset List: flowchart LR
AA[Start Here!] --- A;
style AA fill:#fff,color:#000,stroke-width:4px
A[Unmarked] --- B(Marked);
B --- C(Marked-Zebra);
C --- D(Marked-Lines);
D --- E(Marked-Ladder);
E --- F(Marked-Dashes);
F --- G(Marked-Dots);
G --- H(Marked-LadderSkewed);
H---A;
Here's a breakdown of the actual tag changes we would like to cycle through, given the above flowchart:
|
This is clear @Bonkles. Thanks for providing me with much guidance to work with. |
Description
We currently have a hotkey (shift-C) that cycles through the various 'common' road types. Each time you hit the hotkey, As long as you have a highway selected, the selected way changes its tags according to this sequence:
motorway, trunk, primary, secondary, tertiary, unclassified, residential, living_street, service, track
Once you get to track, the key cycles back to the beginning of the list.
We could do a similar thing with footways, where hitting the hotkey (tbd which one) would cycle through tags if a highway=footway is selected.
What would that tag cycle look like? Something like 'When a highway=footway is selected, cycle through this list':
(In order by popularity of usage from: https://taginfo.openstreetmap.org/keys/crossing:markings#values)
footway=unmarked;crossing:markings=no
footway=marked:crossing:markings=yes
footway=marked;crossing:markings=zebra
footway=marked;crossing:markings=lines
footway=marked;crossing:markings=ladder
footway=marked;crossing:markings=dashes
footway=marked;crossing:markings=dots
The text was updated successfully, but these errors were encountered: