[Python] Is there a way to find the u, v, and key using the osmdata package in R?

Discussão em 'Python' iniciado por Stack, Fevereiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I'm wanting to find all the intersections for every road in a given region that was provided by openStreetMaps. I know in python that it's possible to pull up this information from osmnx. In python, you would be provided u,v, and key, which are the starting intersection, ending intersection, and the label for the road connecting the two points. I wanted to know if there was a way to retrieve this information using osmdata in R.

    When I make my openStreetMaps call, I get all of the roads for my region, however it doesn't return all of their intersections. The following code is my openStreetMaps request.

    city_main = opq(bbox = expanded_bbox) %>%
    add_osm_feature(key = "highway", value = c("motorway","trunk" ,"primary","service","secondary",
    "tertiary","residential")) %>%
    osmdata_sf()


    I tried to find the intersections manually by using st_intersects. However, I confirmed by hand using a sample road that it only returns a small handful of the intersections for that given road. It also returns some roads that don't even intersect the road of interest.

    Finally, I've tried to create a buffer around the road of interest to see if it would pick up the missing intersections, but it didn't pick up any of the missing roads. I'm currently working in WGS84, which is the crs that the retrieved openStreetMaps information is in.

    Any advice or suggestions would be greatly appreciated.

    Continue reading...

Compartilhe esta Página