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

Don't ask for surface, if footway:surface is already tagged. #197

Merged
merged 15 commits into from
Aug 18, 2023
Merged

Don't ask for surface, if footway:surface is already tagged. #197

merged 15 commits into from
Aug 18, 2023

Conversation

Henry00572
Copy link
Contributor

I was asked about the surface of https://www.openstreetmap.org/way/1084496227, which is already tagged with footway:surface and cycleway:surface. I don't think it needs another surface tag.

Don't ask for surface, if footway:surface is set.
@Robbendebiene
Copy link
Member

Thanks for raising this issue. I agree on this, but I think splitting this question into multiple would be the best way to properly solve this problem:

  1. "Wie ist der Boden beschaffen?"
    WRITES: surface
    CONDITION: asked when the way is not segregated or it is unknown whether it is segregated or not (segregated: [false, "no"])
  2. "Wie ist der Boden des Fahrradwegs beschaffen?"
    WRITES cycleway:surface
    CONDITION: asked when the way is segregated (segregated: "yes")
  3. "Wie ist der Boden des Fußwegs beschaffen?"
    WRITES footway:surface
    CONDITION: asked when the way is segregated (segregated: "yes")

Do you feel comfortable adding this to the question_catalog.json? You can also find out more how it works here: https://github.com/OPENER-next/OpenStop/blob/master/docs/QUESTION_CATALOG.md

Edited quest for surface so it is not asked when the way is segregated, but key segregated can be set if the surface differs between foot- and cycleway.
Added quests for footway:surface and cycleway:surface that are asked for segregated foot- and cycleways without surface or *:surface.
@Henry00572
Copy link
Contributor Author

Thanks for the help, I think I have created the quests as you said.
The logic works as follows:

  1. surface is asked if surface is not set and segregated is ["no", false]. However, for segregated ways where one side is paved and the other one unpaved (I still have to add a picture of this situtation, for example here), segregated=yes is set and the following two quests will ask for the surfaces individually.
    2./3, footway:surface and cycleway:surface are asked for highway ["fotway", "cycleway", "path"] with segregated=yes and foot ["yes", "designated"] or bicycle ["yes", "designated"] respectively.

Add image for segregated foot- and cycleway with different surfaces.
Add link to image
@Henry00572
Copy link
Contributor Author

I have now added an image of the situation where a segregated way has different surfaces. In this case, segregated=yes should be set in the surface quest and the individual surfaces can be inserted by the other new quests.
I have also uploaded the image to Wikimedia Commons with CC0 license and I hope it's acceptable.
Thanks again for your help.

Copy link
Member

@Robbendebiene Robbendebiene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work. Looks pretty good!

Also great job with adding an image to wiki commons and licensing it with CC0. That is exactly the way we prefer to go. Even though depending on which direction we decide to go we might prefer a different image.

Comment on lines 1801 to 1809
},
{
"name": "Unterschiedlich",
"image": "assets/images/questions/segregated_surface_paved_unpaved.jpg",
"osm_tags": {
"segregated": "yes"
}
}
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is, that this question is also asked for platforms. There it doesn't make sense to offer segregated as an answer. Though this could be solved by splitting the questions again (one for ways one for platforms).

I find the idea very interesting. I did not think about adding segregated as an answer to this question before.

The only risk in doing so I see is that segregated is meant to be tagged only when the separation/segregation is explicitly denoted with the specific sign. However at least in theory there can be ways with different surfaces that are not segregated in a legal sense.

The other option would be to explicitly ask in a separate question whether a way is segregated or not. Yours is more elegant but potentially prone to errors. Another benefit of this split would be that we can also tag segregated=no because it's unsafe to add it in the surface question.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the problems with the option segregated on platforms and with different surfaces that are not legally segregated. Both could be solved with another quest for the key segregated, although with some more logic.

If we add another quest for segregated, which is asked on ways and not platforms, then if segregated=no is answered, the surface can be answered by the surface quest, and if segregated=yes is set then the other new quests for footway:surface and cycleway:surface apply.

In the case of different surfaces that are not legally segregated, I don't know of any tagging that could describe such a situation and it probably occurs very rarely.

So do you think we should add another quest for segregated?

PS: In an accessibility app there should really be a value of segregated for describing that a way is segregated using tactile paving, but that's another story.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add another quest for segregated, which is asked on ways and not platforms, then if segregated=no is answered, the surface can be answered by the surface quest, and if segregated=yes is set then the other new quests for footway:surface and cycleway:surface apply.

So do you think we should add another quest for segregated?

Yes I think it is the cleanest way even though this means introducing another question.

Perhaps you can make it a List answer type with two entries and add the following images:

Note though that we unfortunately cannot render svgs so converting them to a png is required. (our preferred resolution is 2000 x 2000px)

I only wonder whether it would make sense to construct a more advanced question that covers more legal cases regarding bicycles and pedestrians. (I'm thinking about some of these scenarios: https://wiki.openstreetmap.org/wiki/DE:Bicycle/Radverkehrsanlagen_kartieren). Or are we losing our selves here? 😅


PS: In an accessibility app there should really be a value of segregated for describing that a way is segregated using tactile paving, but that's another story.

Just out of interest, you mean something like this right?

https://www.handi-friendly.com/wp-content/uploads/2021/02/Jirkov-2-scaled.jpg
Or even this https://ecf.com/sites/ecf.com/files/Figure%2038%20v2%20%5BCredit%20Robert%20Weetman%5D.jpg

assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
@Henry00572
Copy link
Contributor Author

Perhaps you can make it a List answer type with two entries and add the following images

Okay, I think I have done that, I had to resolve some conflicts with #200, but I think that works now.
The conditions are quite strict as the question requires highway=path/footway/cycleway + foot=designated + bicycle=designated. If we wanted to

construct a more advanced question that covers more legal cases regarding bicycles and pedestrians

this would probably be too strict. For now, the two options segregated=yes and segregated=no are enough to me.

Just out of interest, you mean something like this right?

Exactly.

Copy link
Member

@Robbendebiene Robbendebiene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think we are almost there!

The last problem I see is that we now only ever ask any surface questions when segragated is set to yes or no. This itself is not necessarily a problem, but since the conditions for writing segregated ourself are very strict (requiring "foot": "designated", "bicycle": "designated") the surface conditions become likewise as strict.

So we could either loosen the constraints for the segregated question or the surface question.
While removing the "foot": "designated", "bicycle": "designated", tags from the segregated question would work, I feel like we rather should tweak the surface questions directly.

For example we could add additional conditions to the questions which ask for the individual surfaces. The following condition would ask the question for footway:surface whenever cycleway:surface is set:

{
    "osm_tags": {
       "highway": ["path", "footway", "cycleway"],
       "cycleway:surface": true,
       "footway:surface": false,
       "indoor": ["no", false]
    },
    "!osm_tags": {
       "access": ["no","private"]
    },
    "osm_element": [
       "OpenWay",
       "ClosedWay"
    ]
 }

Or we could alter the conditions for the "full" surface question like this:

 {
    "osm_tags": {
       "highway": "footway",
       "footway": [false, "sidewalk"],
       "surface": false,
       "indoor": ["no", false],
       "footway:surface": false,
       "cycleway:surface": false,
       "segregated": ["no", false]
    },
    "!osm_tags": {
       "access": ["no","private"]
    },
    "osm_element": [
       "OpenWay",
       "ClosedWay"
    ]
},

Basically this would not ask the questions when a sub surface tag is set (makes it more strict) but still ask the question when segregated is unknown (making it less strict).

assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
assets/datasets/question_catalog.json Outdated Show resolved Hide resolved
@Henry00572
Copy link
Contributor Author

I feel like we rather should tweak the surface questions directly.

I agree.

Basically this would not ask the questions when a sub surface tag is set (makes it more strict) but still ask the question when segregated is unknown (making it less strict).

I think that's the best way to go. I will edit that.

Changed conditions for surface quest
@7h30n3
Copy link
Member

7h30n3 commented Aug 17, 2023

LGTM, except the JSON validation.

@Robbendebiene
Copy link
Member

Last thing from my side would be to also add the extra conditions for the partial surface questions.
I'm talking about the following with the counter part for the cycleway:surface question:

For example we could add additional conditions to the questions which ask for the individual surfaces. The following condition would ask the question for footway:surface whenever cycleway:surface is set:

{
    "osm_tags": {
       "highway": ["path", "footway", "cycleway"],
       "cycleway:surface": true,
       "footway:surface": false,
       "indoor": ["no", false]
    },
    "!osm_tags": {
       "access": ["no","private"]
    },
    "osm_element": [
       "OpenWay",
       "ClosedWay"
    ]
 }

After this it can be merged from my side 🙂

@Henry00572
Copy link
Contributor Author

For example we could add additional conditions to the questions which ask for the individual surfaces. The following condition would ask the question for footway:surface whenever cycleway:surface is set:

Wouldn't this disable both questions on a way with e.g. highway=path + foot=designated + bicycle=designated + segregated=yes? Both questions would depend on the other being answered already, so I think this doesn't work.

@Robbendebiene
Copy link
Member

Wouldn't this disable both questions on a way with e.g. highway=path + foot=designated + bicycle=designated + segregated=yes? Both questions would depend on the other being answered already, so I think this doesn't work.

I think there is a miss-understanding here. I don't want to replace or alter the current condition instead I want to add another one (like we have multiple for the surface question). We use the term "condition" for every direct item denoted with {} in the conditions property which can be confusing sometimes.

So for the footway question it would look like this:

  {
     "question": {
         "name": "Bodenbeschaffenheit Fußweg",
         "text": "Wie ist der Boden des Fußweges beschaffen?",
         "description": "Besteht die Oberfläche aus Schotter, Sand, Gras oder einem vergleichbaren Belag, so handelt es sich um einen unbefestigten Bodenbelag."
      },
      "answer": {
         "type": "List",
         "input": [
            {
               "name": "Befestigt",
               "image": "assets/images/questions/surface_paved.jpg",
               "osm_tags": {
                  "footway:surface": "paved"
               }
            },
            {
               "name": "Unbefestigt",
               "image": "assets/images/questions/surface_unpaved.jpg",
               "osm_tags": {
                  "footway:surface": "unpaved"
               }
            }
         ]
      },
      "conditions": [
         {
            "osm_tags": {
               "highway": ["path", "footway", "cycleway"],
               "segregated": "yes",
               "surface": false,
               "footway:surface": false,
               "indoor": ["no", false]
            },
            "!osm_tags": {
               "access": ["no","private"]
            },
            "osm_element": [
               "OpenWay",
               "ClosedWay"
            ]
         },
        {
            "osm_tags": {
               "highway": ["path", "footway", "cycleway"],
               "cycleway:surface": true,
               "footway:surface": false,
               "indoor": ["no", false]
            },
            "!osm_tags": {
               "access": ["no","private"]
            },
            "osm_element": [
               "OpenWay",
               "ClosedWay"
            ]
         }
      ]
 }

For the cycleway question it would look like this:

  {
      "question": {
         "name": "Bodenbeschaffenheit Radweg",
         "text": "Wie ist der Boden des Radweges beschaffen?",
         "description": "Besteht die Oberfläche aus Schotter, Sand, Gras oder einem vergleichbaren Belag, so handelt es sich um einen unbefestigten Bodenbelag."
      },
      "answer": {
         "type": "List",
         "input": [
            {
               "name": "Befestigt",
               "image": "assets/images/questions/surface_paved.jpg",
               "osm_tags": {
                  "cycleway:surface": "paved"
               }
            },
            {
               "name": "Unbefestigt",
               "image": "assets/images/questions/surface_unpaved.jpg",
               "osm_tags": {
                  "cycleway:surface": "unpaved"
               }
            }
         ]
      },
      "conditions": [
         {
            "osm_tags": {
               "highway": ["path", "footway", "cycleway"],
               "segregated": "yes",
               "surface": false,
               "cycleway:surface": false,
               "indoor": ["no", false]
            },
            "!osm_tags": {
               "access": ["no","private"]
            },
            "osm_element": [
               "OpenWay",
               "ClosedWay"
            ]
         },
        {
            "osm_tags": {
               "highway": ["path", "footway", "cycleway"],
               "footway:surface": true,
               "cycleway:surface": false,
               "indoor": ["no", false]
            },
            "!osm_tags": {
               "access": ["no","private"]
            },
            "osm_element": [
               "OpenWay",
               "ClosedWay"
            ]
         }
      ]
},

Add additional conditions for individual surface quests and fix mistake
@Henry00572
Copy link
Contributor Author

I want to add another one (like we have multiple for the surface question). We use the term "condition" for every direct item denoted with {} in the conditions property which can be confusing sometimes.

Thanks for clearing that up, I understand now and have added this condition.

Copy link
Member

@Robbendebiene Robbendebiene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thank you for your contribution 🙂

@Robbendebiene Robbendebiene merged commit cb2c0a3 into OPENER-next:master Aug 18, 2023
3 checks passed
@Henry00572
Copy link
Contributor Author

Thanks for all the help!

@Henry00572 Henry00572 deleted the ConflictsResolved branch August 18, 2023 09:16
yulieth9109 pushed a commit to yulieth9109/OpenStop that referenced this pull request Aug 31, 2023
* Add question whether a way is segregated
* Add separate surface question for segregated footways
* Add separate surface question for segregated cycleways
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

Successfully merging this pull request may close these issues.

3 participants