# Sort order of numbered streets?

**URL:** <https://community.citystrides.com/t/sort-order-of-numbered-streets/19840>\
**Category:** Support\
**Created:** [April 7, 2020, 9:02pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840 "2020-04-07T21:02:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericjrw](https://community.citystrides.com/user_avatar/community.citystrides.com/ericjrw/32/1065_2.png) [@ericjrw](https://community.citystrides.com/u/ericjrw)\
**Post date:** [April 7, 2020, 9:02pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840/1 "2020-04-07T21:02:28Z")

</div>

I was recently striding in [St. Pete Beach, FL](https://citystrides.com/cities/9162), where there are a lot of numbered streets, starting at the south end with “1st Ave” and going north up to about “90th Ave”.

I noticed that the **first** street listed for St. Pete is not “1st Ave”, it’s “10th Ave”. The list continues to “19th Ave”, then “1st Avenue”, then “1st Palm Point Street”. Then, after all the "1"s, come the "20"s, after the "20"s, comes the "2"s, then the "30"s, then the "3s, and so one.

I could probably find my “programmer’s hat” somewhere, and speculate on the sort… But I really thought @JamesChevalier might like to see a new post without the word “missing” in the subject. 🙂

I suspect it has to do with the ASCII value of the characters in the street name string, not the numerical value of the the street number 0x31 0x30 (“10”) comes before 0x31 0x73 (“1s”).

Anyway, as I was planning my next trip to SPB (74.25% of 167 streets), I was reminded of this, and thought I would post. Next trip I should have my first completed city.

Thank you, Eric

PS, sorry if you saw before the edit, I forgot the “monkey” (I used to work with a Polish team, and that’s what they say for @, instead of “at”), and I picked it up. The actual word they used was “malpa”, Polish for monkey.

---

<div class="post-metadata">

**Author:** ![Marty](https://community.citystrides.com/letter_avatar_proxy/v4/letter/m/f0a364/32.png) [@Marty](https://community.citystrides.com/u/Marty)\
**Post date:** [March 3, 2021, 5:14pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840/2 "2021-03-03T17:14:11Z")

</div>

Bumping with screenshots

‘1 Alley’ being the last listed for 1s & ‘15th Street’ jumping the line

 ![Sort1](https://d25dflut6m8e53.cloudfront.net/original/2X/a/ad81de3cfab0cff4cd14d88df3cc4efb7e43075b.png)

* * *

‘2 Alley’ & ‘3 Alley’ not being sequentially next to each other

 ![Sort2](https://d25dflut6m8e53.cloudfront.net/original/2X/c/cbcf11adfa6c02dc523ddd75916603665699760e.png)

---

<div class="post-metadata">

**Author:** ![JamesChevalier](https://community.citystrides.com/user_avatar/community.citystrides.com/jameschevalier/32/2_2.png) [@JamesChevalier](https://community.citystrides.com/u/JamesChevalier)\
**Post date:** [March 4, 2021, 3:07pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840/3 "2021-03-04T15:07:52Z")

</div>

It looks like numbers are sorted prior to spaces.

```auto
18[space]Alley
19[space]Alley
1[space]Alley

```

It looks like it’d be _possible_ to change this ([some examples of how in here](https://stackoverflow.com/questions/11417975/alphanumeric-sorting-with-postgresql)), but I have no interest in adding that complexity while a simple `.order(:name)` gets us close enough.

---

<div class="post-metadata">

**Author:** ![tev4](https://community.citystrides.com/user_avatar/community.citystrides.com/tev4/32/2077_2.png) [@tev4](https://community.citystrides.com/u/tev4)\
**Post date:** [March 5, 2021, 11:18pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840/4 "2021-03-05T23:18:38Z")

</div>

Computer scientists would have named this “02 Alley”. 🙂

---

<div class="post-metadata">

**Author:** ![fredrik.coulter](https://community.citystrides.com/letter_avatar_proxy/v4/letter/f/ce7236/32.png) [@fredrik.coulter](https://community.citystrides.com/u/fredrik.coulter)\
**Post date:** [March 6, 2021, 10:35pm UTC](https://community.citystrides.com/t/sort-order-of-numbered-streets/19840/5 "2021-03-06T22:35:14Z")

</div>

Computer Scientists would have named it 01 Alley, and started the numbering of alleys at 00.
