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

Better "walk" filter for networks with separately mapped sidewalks #1253

Closed
3 tasks done
winnewoerp opened this issue Dec 12, 2024 · 4 comments
Closed
3 tasks done

Better "walk" filter for networks with separately mapped sidewalks #1253

winnewoerp opened this issue Dec 12, 2024 · 4 comments

Comments

@winnewoerp
Copy link

Contributing guidelines

  • I understand the contributing guidelines

Documentation

  • My proposal is not addressed by the documentation or examples

Existing issues

  • Nothing similar appears in an existing issue

What problem does your feature proposal solve?

Sidewalks have already been mapped as separate geometries in numerous neighborhoods worldwide. Where this is done correctly, the roadway (street centerline) is being tagged as not to be used by pedestrians using sidewalk=separate, sidewalk:both=separate, sidewalk:left=separate or sidewalk:right=separate. With the current version, the network type "walk" in OSMnx does still include such edges.

Test both versions here:
Current https://overpass-turbo.eu/s/1VBe
Proposed https://overpass-turbo.eu/s/1VBg

What is your proposed solution?

I propose adding the necessary rules to the "walk" filter.

What alternatives have you considered?

A workaround is of course to filter using a manual solution, but this can be avoided with the proposed solution.

Additional context

    # New version of the "walk" filter in osmnx/_overpass.py

    filters = {}
    
    filters["walk"] = (
        f'["highway"]["area"!~"yes"]{settings.default_access}'
        f'["highway"!~"abandoned|bus_guideway|construction|cycleway|motor|no|planned|platform|'
        f'proposed|raceway|razed"]'
        f'["foot"!~"no"]["service"!~"private"]'
        f'["sidewalk"!~"separate"]["sidewalk:both"!~"separate"]'
        f'["sidewalk:left"!~"separate"]["sidewalk:right"!~"separate"]'
    )
@gboeing
Copy link
Owner

gboeing commented Dec 13, 2024

Thanks @winnewoerp this looks great. Is this tagging convention documented as official on the OSM wiki? Could you link it here in a comment for reference?

@gboeing
Copy link
Owner

gboeing commented Dec 13, 2024

Here's the answer to the question: https://wiki.openstreetmap.org/wiki/Tag:sidewalk%3Dseparate

@winnewoerp
Copy link
Author

So, the answer is "yes", right? Of course, this is currently not relevant for the largest part of the world, as this LoD of sidewalk mapping is still rare. But the other way round, there are no problems when it's included.

BTW: The filter(s) could also be written like this (saving a few bytes):

filters["walk"] = (
        f'[highway][area!=yes]{settings.default_access}'
        f'[highway!~"abandoned|bus_guideway|construction|cycleway|motor|no|planned|platform|'
        f'proposed|raceway|razed"]'
        f'[foot!=no][service!=private]'
        f'[sidewalk!=separate]["sidewalk:both"!=separate]'
        f'["sidewalk:left"!=separate]["sidewalk:right"!="separate"]'
    )

Keys/values not containing any special characters don't need quotes.

Thanks for your great tool!!

@gboeing
Copy link
Owner

gboeing commented Dec 16, 2024

Closed by #1254

@gboeing gboeing closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants