Discussing 'nested' cities

There’s been an ongoing issue where it appears as though streets are being counted as completed twice. There’s this thread with some conversation on the topic: Fixing street double count

I approached this by:

  • Adding the ability to mark a city as “nested”
  • Adding the ability to relate a nested city to its parent city (a link to the parent city is displayed on nested city pages)
  • Not including nested cities when doing street counts
  • Not including nested cities in the Challenge calculations (unless the Challenge happens to be on a nested city)

I’m currently running some code that finds/marks these nested cities. It seems to be running quickly.

While I was working on this, I noticed some cities that are kind of nested. Which… :roll_eyes: Of course… Right? :sweat_smile:
One example is the southern area of Pomona Pomona, New York - CityStrides which sticks out of the border of Town of Haverstraw Town of Haverstraw, New York - CityStrides
:man_shrugging:
Gotta figure out what to do with those.

1 Like

Very cool! I’ll get started with my new home base of Lisboa, Portugal. There are a lot of neighborhoods that are subsections and the roads here double- or even multi-count: for example, Rua Ramalho Ortigão (22 nodes) = this (13 nodes) + this (9 nodes), and counts as 3 individual streets.

The following “cities” (really, neighborhoods) should be nested in Lisboa:

Benfica

São Domingos de Benfica

Carnide

Avenidas Novas

Campolide

Ajuda

Alcântara

Santa Maria Maior

Misericórdia

Belém

Lumiar

Santo António

Estrela

The following “cities” should be nested in Amadora, which isn’t in the cities list for the Lisboa region…a separate problem that I only realized when assembling this list.

Águas Livres

Falagueira-Venda Nova

Alfragide

Encosta do Sol

There are a bunch of other neighborhoods in Lisboa and Amadora that I haven’t run yet, but since I’m the first to respond I don’t know if this is overkill or if you can extract the other neighborhoods/sub-sections once you have the city link. Hope this helps and thanks as always for your constant improvements to a great platform.

1 Like

Awesome, not sure if I made this clear already, I’ll leave it here anyway so you have it all in one place. All the cities in the missing cities spreadsheet under Region: Oslo, should be nested under Oslo when added :slight_smile:

1 Like

For Cardiff, UK we have;

Parent city: Cardiff, Cymru / Wales - CityStrides
Nested city: Canton, Cymru / Wales - CityStrides
Nested city: Ely, Cymru / Wales - CityStrides
Nested city: Caerau, Cymru / Wales - CityStrides
Nested city: Llandaff, Cymru / Wales - CityStrides
Nested city: Llandaff North, Cymru / Wales - CityStrides
Nested city: St. Fagans, Cymru / Wales - CityStrides
Nested city: Radyr and Morganstown, Cymru / Wales - CityStrides
Nested city: Pentyrch, Cymru / Wales - CityStrides
Nested city: Whitchurch, Cymru / Wales - CityStrides
Nested city: Tongwynlais, Cymru / Wales - CityStrides
Nested city: Rhiwbina, Cymru / Wales - CityStrides
Nested city: Thornhill, Cymru / Wales - CityStrides
Nested city: Lisvane, Cymru / Wales - CityStrides
Nested city: Butetown, Cymru / Wales - CityStrides
Nested city: Grangetown, Cymru / Wales - CityStrides
Nested city: Castle, Cymru / Wales - CityStrides
Nested city: Riverside, Cymru / Wales - CityStrides
Nested city: Heath, Cymru / Wales - CityStrides
Nested city: Llanishen, Cymru / Wales - CityStrides
Nested city: Cathays, Cymru / Wales - CityStrides
Nested city: Gabalfa, Cymru / Wales - CityStrides
Nested city: Roath, Cymru / Wales - CityStrides
Nested city: Adamsdown, Cymru / Wales - CityStrides
Nested city: Splott, Cymru / Wales - CityStrides
Nested city: Tremorfa, Cymru / Wales - CityStrides
Nested city: Penylan, Cymru / Wales - CityStrides
Nested city: Cyncoed, Cymru / Wales - CityStrides
Nested city: Llanedeyrn, Cymru / Wales - CityStrides
Nested city: Pentwyn, Cymru / Wales - CityStrides
Nested city: Pontprennau, Cymru / Wales - CityStrides
Nested city: Llanrumney, Cymru / Wales - CityStrides
Nested city: Rumney, Cymru / Wales - CityStrides
Nested city: Trowbridge, Cymru / Wales - CityStrides

(Think that is all of them)

1 Like

This seems like a silly thing to ask humans to do. Surely a computer can figure out which polygons are inside which other polygons.

You’re making some assumptions on a number of things, but the point of at least trying to do this programmatically is a good idea.

1 Like

Parent City:
Edinburgh, Scotland - CityStrides Edinburgh (City of Edinburgh Council Unitary Authority)

Nested Cities: (Community Council Areas in OSM : 29 of 46)
Balerno, Scotland - CityStrides Balerno
Craigentinny/Meadowbank, Scotland - CityStrides Craigentinny/Meadowbank
Craigmillar, Scotland - CityStrides Craigmillar
Currie, Scotland - CityStrides Currie
Drylaw/Telford, Scotland - CityStrides Drylaw/Telford
Gilmerton/Inch, Scotland - CityStrides Gilmerton/Inch
Gorgie/Dalry, Scotland - CityStrides Gorgie/Dalry
Granton and District, Scotland - CityStrides Granton and District
Hutchison/Chesser, Scotland - CityStrides Hutchison/Chesser
Juniper Green, Scotland - CityStrides Juniper Green
Leith Central, Scotland - CityStrides Leith Central
Leith Harbour & Newhaven, Scotland - CityStrides Leith Harbour & Newhaven
Leith Links, Scotland - CityStrides Leith Links
Liberton and District, Scotland - CityStrides Liberton and District
Longstone, Scotland - CityStrides Longstone
Muirhouse/Salvesen, Scotland - CityStrides Muirhouse/Salvesen
New Town/Broughton, Scotland - CityStrides New Town/Broughton
Northfield/Willowbrae, Scotland - CityStrides Northfield/Willowbrae
Old Town, Scotland - CityStrides Old Town
Portobello, Scotland - CityStrides Portobello
Sighthill, Broomhouse and Parkhead, Scotland - CityStrides Sighthill, Broomhouse and Parkhead
Southside, Scotland - CityStrides Southside
Stenhouse, Saughton Mains and Whitson, Scotland - CityStrides Stenhouse, Saughton Mains and Whitson
Stockbridge/Inverleith, Scotland - CityStrides Stockbridge/Inverleith
Tollcross, Scotland - CityStrides Tollcross
Trinity, Scotland - CityStrides Trinity
West End, Scotland - CityStrides West End
Wester Hailes, Scotland - CityStrides Wester Hailes
West Pilton/West Granton, Scotland - CityStrides West Pilton/West Granton

Community Council Areas missing from OSM (17 of 46):
Colinton
Corstorphine
Craigleith/Blackhall
Craiglockhart
Cramond and Barnton
Drum Brae
Fairmilehead
Firrhill
Grange/Prestonfield
Kirkliston
Marchmont & Sciennes
Merchiston
Morningside
Murrayfield
Ratho and District
Silverknowes
Queensferry and District

2 Likes

While Aberdeen, Scotland doesn’t have a boundary line in CS, the following all fall within the city I believe:

Parent City:
Aberdeen, Scotland - CityStrides Aberdeen (no boundary line)

Nested cities:
Bridge of Don, Scotland - CityStrides Bridge of Don
Castlehill and Pittodrie, Scotland - CityStrides Castlehill and Pittodrie
Cove and Altens, Scotland - CityStrides Cove and Altens
Froghall, Powis and Sunnybank, Scotland - CityStrides Froghall, Powis and Sunnybank
George Street, Scotland - CityStrides George Street
Old Aberdeen, Scotland - CityStrides Old Aberdeen
Seaton, Linksfield and Pittodrie, Scotland - CityStrides Seaton, Linksfield and Pittodrie
Tillydrone, Scotland - CityStrides Tillydrone
Torry, Scotland - CityStrides Torry

2 Likes

Thanks, I fixed that border.

1 Like

Thanks, that now shows that the 9 nested cities only cover about a third of the parent city. Similar to Edinburgh.

This is awesome! Thanks for doing this. I’m curious if there’s a way now to create new nested cities so that gigantic areas (like Queens or Brooklyn) can be broken up into more bite sized chunks.

It depends on what data is present in OSM. For example, there’s Manhattan Manhattan, New York - CityStrides (admin level 7) and then there’s also its Community Boards e.g. Manhattan Community Board 1, New York - CityStrides (admin level 8).
Queens exists at admin level 7 Relation: ‪Queens‬ (‪9691819‬) | OpenStreetMap but I haven’t been able to find any admin levels below that within Queens…

Wish this could be done for Boston too. I would have been much more interested in trying to finish Allston or Jamaica Plain if that were the case.

2 Likes

First you’d have to figure out where those boundaries even are! On the impossibility of mapping Boston neighborhood lines | Universal Hub

1 Like

A post was split to a new topic: How to add admin level data to OSM?

So what do you see this as the scope of this? Limited to fixing double street counts, or can it be expanded to split big cities into smaller chunks or combine small villages into bigger targets?

All of the city border data comes from OpenStreetMap. If sub-sections of a city exist in there, I can import those into CityStrides as nested cities.
I’ve done that for a number of larger cities & I’m happy to add more.

One thing I’ve noticed is some roads in “nested cities” that are in the nested city but not the larger city don’t count at all. I don’t know why, I haven’t investigated in OSM, but for instance in my recent activity (CityStrides) there are 15 unique street names in my completed list, but it only says 9 completed (the 9 that would previously have double-counted). Before Benfica was nested in Lisboa, this run would have shown 24 completed streets (9 x 2 + 6) but the solution to that problem now under-counts the streets I did complete :confounded:

I’ve been trying to figure out Aberdeen, actually. The smaller nested cities has been helpful to me since I live in the midst of all those, but it’s clearly a broken system. I covered a road last week (Prospect Terrace) which has the same name as a road in Dyce. OSM/CS seems to treat them as the same road, given that Dyce is part of Aberdeen (despite being significantly far apart). I wonder if mapping Dyce as a separate, nested boundary would help sort problems like that out?

I also couldn’t figure out why “Castlehill and Pittodrie” or “Froghall, Powis and Sunnybank” are a separate area of the city while Cults, Dyce, Bieldside, Kincorth, etc. aren’t. To my knowledge, these aren’t historically separate towns which merged (unlike Torry, Old Aberdeen, and Bridge of Don, but are somewhat random groupings. They don’t seem to follow any specific metrics for being bound - any insights as to what sets them apart?

I think the boundaries for the nested ‘cities’ in OSM for Aberdeen are, like Edinburgh, for community councils, but I think it may be a work in progress and not all of the Aberdeen community council areas have been added to OSM yet. Here’s the full list: Community Councils | Aberdeen City Council

Hope that helps.

1 Like