sharedstreets / sharedstreets-python

SharedStreets (Python)
https://sharedstreets.io
MIT License
64 stars 16 forks source link

sharedstreets.tile.get_tile doesn't get dedicated infraestructure for buses like BRT in Buenos Aires #20

Open alephcero opened 6 years ago

alephcero commented 6 years ago

I'am running Python 3.6.5 Using the python library on Buenos Aires City with sharedstreets.tile.get_tile(12, 1383, 2468) I get

sharedstreets_python

There you can see Metrobus Network (Buenos Aires BRT) is missing in the geometries.

While in you online map you can see it loaded to sharedatreets network https://platform.sharedstreets.io/-34.62128/-58.37974/16.467/

The OSM tag on the Metrobus BRT shows access=no, bus=yes as specified in the OSM docs

migurski commented 6 years ago

Thanks for the report! This might be related to the road class filter in the tiles we use? Can you try passing a different URL template to get_tile(), vs. the default in https://github.com/sharedstreets/sharedstreets-python/blob/master/sharedstreets/tile.py#L9

E.g. replace the 6 with a 7; if that fixes it then I’ll improve the documentation around this.

alephcero commented 6 years ago

I used the following template:

tile = sharedstreets.tile.get_tile(12, 1383, 2468,data_url_template = 'https://tiles.sharedstreets.io/osm/planet-180312/{z}-{x}-{y}.{layer}.7.pbf') It returns and empty collection:

{'type': 'FeatureCollection', 'features': [], 'references': []}

Using the following line in OSMNX i get those roads

point= (-34.620486, -58.380824)
G = ox.graph_from_point(point,distance=500,network_type = 'drive_service')
migurski commented 6 years ago

Hm, maybe that’s not the URL. @kpwebb do you have an index of URLs that I’m mis-remembering? Any updates on https://github.com/sharedstreets/sharedstreets-ref-system/issues/20?

kpwebb commented 6 years ago

@alephcero and @migurski thanks for flagging this.

On the first point about metro bus segments, that's very likely a road class issue. Per Mike's point, "level 6" is currently clipping out roads unless they're "tertiary" or greater, or "unclassified". It's likely the busway doesn't meet that criteria.

At the moment we only have "level 6" tiles up on the tile endpoint, but we can add level 7 (service) and 8 (other). We're also in the process of adding a "level 9" for bike and ped infrastructure.

As a starting point I'll copy up the existing 7 and 8 tiles, and update this thread. I'm curious if that addresses the busway.

In case you're interested you can see how we define the levels here -- I'll move this into the reference spec documentation:

https://github.com/sharedstreets/sharedstreets-builder/blob/a554983e96010d32b71d7d23504fa88c6fbbad10/src/main/java/io/sharedstreets/tools/builder/osm/model/Way.java#L7

https://github.com/sharedstreets/sharedstreets-builder/blob/a554983e96010d32b71d7d23504fa88c6fbbad10/src/main/java/io/sharedstreets/tools/builder/osm/model/Way.java#L61

alephcero commented 6 years ago

That's great news!

I'll wait for the updates and glad to help in this project!