Streets spanning two cities with one node in one city

We’re now focusing on two separate pieces of data. I don’t seem to be doing a good job of articulating the nuance of this issue.

Your screenshot is focused on the section with purple nodes in the image below. That’s the known good street that is and should be included in Easthampton. Everything is working as we would both expect it to there.

Over on the eastern side, under the text “Mount Tom”, there’s a red node that is used in two Way records in OpenStreetMap - North Street in Easthampton (great! bring it in!) and Northampton Street in Holyoke (No! Wrong city!).

There is nothing made up here in this very specific but important example. The Northampton Street with the red node in this image does not exist in Easthampton and should not be included. Looking at specifically and only this street in these two cities, we are likely in agreement.

In cases like Prunella Place, it’s different.

Let’s assume the city border is correct, and Prunella Place actually straddles both Havant & Winchester (tough for me to determine, because general searches place it in Waterlooville, Hampshire… but I’m not using either of those admin levels & the OSM boundary for Waterlooville doesn’t agree :person_shrugging: whatever, I can only deal with one catastrophe at a time). The result should be that you’ve got a piece of Prunella Place in Havant, and a piece in Winchester. We’re both agreeing on this.

Oh, you’ve also missed Updates on October 31, 2025 (Release 1314) which is the root cause of this issue.

The background is that the previous data source was incredibly unreliable, adding to the slowness of city syncing. It got to the point where the system had to retry collecting city data multiple times before it would return data successfully. I had to do something about this, it was not sustainable long term.

That previous system had what I think was a kind of dual query that would gather a collection of Way records that passed through the city border, as well as another set of data for all the nodes within the city border. As far as I could tell, this was excluding nodes on the border. This is what allowed it to properly exclude that node from Northampton Street in Holyoke while also including the relevant node from Prunella Place. I didn’t need a “no single node streets” rule.

I haven’t figured out the PostGIS query that’s comparable to that old Overpass query yet. It’s currently operating on a kind of “pass into or touch“ definition, which is incorrectly including streets like Holyoke’s Northampton Street within Easthampton because it touches. The best way I could temporarily handle this was to exclude single node streets. Unfortunately, it matches both streets where the way record only touches the border as well as streets where the way record only has one node validly within the border.

Going back to my earlier reply, this is a no-win temporary choice … I either upset/confuse people because extra streets are incorrectly added, or I upset/confuse people because some straddling streets are removed. In my quick research, this issue looked skewed in the chosen direction - fewer streets would be removed than would have been incorrectly added.

This is interesting! I’m not aware of any such Way record. Do you happen to have a link for me to check out?