How to get the most optimal walk through all streets of Paris?

Hello everyone,

I have this project to walk across all streets of Paris (Relation: ‪Paris‬ (‪1641193‬) | OpenStreetMap).

In order to optimize that walk (I hear that there are ~1600km of streets in Paris), I would like to code or get a program that uses OSM data of all walkable paths in Paris and finds the optimized way to walk it.

Has anyone of you already done that ?

I have some programming skills so if not, how would I extract the data that I need ?

Data that I need : All walkable paths of Paris

Thanks all

Nicolas

1 Like

Hi and welcome to OSM

You first need to clearify (for yourself) what is “Paris”? → Relation: ‪Paris‬ (‪1641193‬) | OpenStreetMap ?
What is a “walkable path” → Key:highway - OpenStreetMap Wiki

The solution for your problem might be in Chinese postman problem - Wikipedia

Thank you. I Clarified the city.

As for walkable paths, I think I would include (from Key:highway - OpenStreetMap Wiki):
highway :

  • [ living_street ]
  • [service ]
  • [pedestrian ]
  • [track ]
  • [road ]
  • [footway ]
  • [bridleway ]
  • [ steps ]
  • [ path ]

footway:

  • [sidewalk ]

sidewalk :

  • both | left | right

I don’t know if all those apply, I would like to walk through all the streets, I’m not sure about those specifics.

I don’t know if all those apply, I would like to walk through all the streets, I’m not sure about those specifics.

I think it will be too long :smiley:

There is website http://www.everystreetchallenge.com/
Note that it won’t work for whole Paris: there is limit of 3km^2.

5 Likes

Very nice, that’s not enough though ahah. Let’s be more precise.
@PHerison gave me an idea of the kind of algorithm I could use for this.
Is there a way to extract all path of types that are indicated just above within the city of Paris ?
So that I can take a look at what it is and code an algorithm on this.

Thanks

My suggestion would be to load the relevant OSM data into a PostGIS database with the osm2pgsql tool. You could start with this extract http://download.geofabrik.de/europe/france/ile-de-france-latest.osm.pbf and slim it down to the exact Paris boundary using e.g. the osmium program, or load the full data into PostGIS and filter for the relevant extract there. (Or use download sites like bbbike.org or protomaps.com where you can specify the download boundary.)

Working with PostGIS will allow you to perform all kinds of data manipulation, for example you can have PostGIS calculate the total length of things, or you can apply logic to exclude something if it is very close to something else of the same name (e.g. you might not have to walk both directions of a street that has separate lanes for each direction like here OpenStreetMap). PostGIS would also allow you to easily combine different sections of the same street into one (for example Way: ‪Rue Robert Degert‬ (‪27448714‬) | OpenStreetMap and Way: ‪Rue Robert Degert‬ (‪477679677‬) | OpenStreetMap are two bits of the same street).

You will still have to code the algorithm (perhaps it is worth looking at PGRouting which could help) but PostGIS will give you many opportunities to pre-process the data as needed.

2 Likes

It’s on Github GitHub - matejker/everystreet: An algorithm finding #everystreet route on Open Street Map (OSMnx) so maybe it can be run locally without the size limit. Unsure how the underlying “osmnx” library works though and what APIs it uses - if it is hell-bent on downloading all of Paris from OSM or Overpass then it might fail but if it can be made to load a local file then it could work.

2 Likes

Please note that you may be in need to clarify this further more.

Ways with highway=footway may be just separately drawn sidewalks. This way you will have three parallel ways (sidewalk left/right + carriageway). If your algorithm wants to walk all OSM ways, you may end up three times in the same street. These sidewalks could be marked as footway=sidewalk, but this is just optional (even if recommended).

On the other hand: As many sidewalks are not mapped separately you may also add the the highway=primary and others to your list.

On highway=service you will often end on private property. Depending on your desired results you should think about excluding them. This may be especially relevant if the additional tags access=private (or similar) or service=driveway are attached to the way.
(Access=private may also be relevant for other ways, too.)

2 Likes

Hello, everyone, a small update regarding that question.

I simply took the code @woodpeck suggested. I adapted it to work for Paris.
Unfortunately, it is very long to run and I don’t think it will end sometimes on my computer.
I decided to do Arrondissement by Arrondissement in Paris.
I will start walking tommorow by the 5th arrondissement I will update here as I go for good practices regarding types of roads and results the algorithm and map yields in a city like Paris with weird streets organizaiton.

Cheers everyone