Option to order by completed street length

Rather than search by name, ordered alphabetically, add an option to order completed streets by length (physical distance ideally, or number of nodes, which may be easier)

As has been mentioned elsewhere, street length isn’t really something that either City Strides or Open Street Maps (the underlying source of the maps) knows anything about. In fact, Open Street Maps doesn’t even know what a street is.

1 Like

But OSM, and CityStrides, have a coordinate system, right?

You edit in OSM, you bring up a satellite layer (view). CityStrides also has a satellite view. And we see our traces on those views. So, while OSM may not know what a street is, the (OSM) “way” we call a street has GPS coordinates, and from that a length can, I should think, be calculated.

I have a similar thought. I do wonder which street in my area, or state, or country, has the most nodes! Or which streets are the most dense with nodes (I’ve seen some crazy curves).

I like it.

It is possible to perform the calculation using the GPS coordinates, that’s true.
I’ve read that the tough thing about it is neither OSM nor CityStrides has an intrinsically ordered set of nodes in a given way (or in CityStrides’ combinations of ways as proxies for streets), so it’s not as simple as calculate A->B, calculate B->C then add them up.

I believe it would require a totally different way or organizing the data, or an additional, computationally intensive process to sort through the nodes, and then also calculate the distances between them.

One other complicating factor is that some ways are combined in different parts of the city, so some distances would be very off.

A third factor is non-contiguous roads. Here in my town, it is pretty common for a road to go for several blocks, then stop. After a couple block of no road, the same road reappears and continues on for another few blocks.

Should the length of the road include those sections where there is no road?

This is just one simple example, it can get much worse: North Delaware Avenue in DeLand, Florida - CityStrides

1 Like

@fredrik.coulter that’s a good point too. Gets complicated quick. I think it would require every single node having information about the nodes it is connected to, which doesn’t currently exist. It’s an interesting technicality that seems like it should be easy but I think is actually challenging.

@davemorin,
Are you sure that this information about node connections is lacking?
I believe @petje checked this a few months ago and gave @JamesChevalier a plausible explanation about the connection of OSM ways.

I’m not 100% confident, no and I remember that post you’re mentioning.
Was it in this post about Total Miles in a City? Jim didn’t comment there.

For technical calculating street length, i think the info is in OSM. OSM is in a sense only a database with GPS allocated point = nodes. Giving these nodes tags, makes it possible to render them into maps. A street is a relations between nodes. Those 2 nodes know from each other, and the relation is a vector line with also a tag. By naming the node that it belongs to a street name and on the relation between 2 nodes also a street name, you could calculate length of a street.

if a street is made of 4 nodes and one end of a street is connected to a crossroad, and so to other streets, one should do the following:

  • determine the relation from node 1 to the next node with the same streetname (this node 1 has only on streetname attached)
  • the 2nd node has a relation to nodes 1 and 3(left and right) and all have the same streetname.
  • the 4th node has a connection to node 3 with the same streetname and to one or more other nodes, but those streetnames are different, This means this is the other node giving the street end.
  • calculate the length of the relation between 1-2, 2-3, 3-4 would give the streetlength.

In the below example for instance (randomly chosen), you see a relation with a streetname and node 1 and node 2 with the same connection to that relation and node 1 ha s also a connection to another street as end point, so does node number 2.


If the street is interrupted and goes further somewhere else, repeat above and add all up.

The only situation i can think of that this is not working is when there are parallel ways on a street, inidividually drawn as relations. That would mess up the calculation. A workaround would be to look at the one-way tag. And only calculate one of the 2 directions in the street length.

1 Like

It’s really not THAT complicated. Add up the distance between nodes for each segment of the street. Add up the segment distances. Voila! You have the distance of the street.

check out James his explanation why that is not the case in OSM:

1 Like