Giter Club home page Giter Club logo

Comments (6)

gboeing avatar gboeing commented on May 28, 2024

OSMnx provides comprehensive tools for street network retrieval and analysis but lacks explicit functionality to identify and classify junction types directly from OpenStreetMap (OSM) data.

Note that the settings module has a useful_tags_node setting you can use to specify what node attributes you want to retrieve/retain from OSM (similarly there's a useful_tags_way setting for edge attributes). See the docs. For example, to add in "junction" attributes you can use:

import osmnx as ox
ox.settings.useful_tags_node += ["junction"]
G = ox.graph.graph_from_place("Piedmont, CA, USA", network_type="drive")

We could also consider updating the default value of this setting if there are certain attributes that are universally valuable but currently missing by default.

from osmnx.

gboeing avatar gboeing commented on May 28, 2024

Although the user can configure their graph's node attributes with the settings.useful_tags_node setting, I think @EwoutH has a good suggestion about the usefulness of including junction data by default.

I propose we update the settings.useful_tags_node from its current ["highway", "ref"] value to ["highway", "junction", "railway", "ref"] instead. This would capture common "junction" information as node attributes, and OSMnx aims to model junctions as nodes after all. If the user needs other custom information added as node attributes, the useful_tags_node setting is always available for them to configure however desired.

It also may make sense to retain the merged nodes' attributes (as a list of unique values, just like the simplify_graph function does) in the simplification.consolidate_intersections function (namely, in "step 5" of its source code). Currently it only retains their original osmid values as a list, plus the new node's x and y coordinates.

Finally, we may want to build on #1117 (see also #625) to flexibly relax graph simplification strictness on a list of node attributes. That would allow users to specify node attribute keys (like "highway") that, if present, denotes a node as an endpoint no matter what. Perhaps the simplify_graph function should accept a node_attrs list argument to this end. And perhaps if we do go this route, that function maybe should have its new endpoint_attrs argument renamed to edge_attrs for clarity.

from osmnx.

gboeing avatar gboeing commented on May 28, 2024

This would also be useful for capturing the presence of stop signs, traffic signals, and pedestrian crossings. If we do change the simplify_graph function as I mentioned, that would allow you to keep those kinds of nodes in a simplified graph.

from osmnx.

EwoutH avatar EwoutH commented on May 28, 2024

Thanks for thinking about this! I will get back in more detail Monday, but I like the general approach.

from osmnx.

gboeing avatar gboeing commented on May 28, 2024

Resolution in #1144 with the simplification enhancement I mentioned in #1145.

from osmnx.

EwoutH avatar EwoutH commented on May 28, 2024

Thanks!

from osmnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.