python-us icon indicating copy to clipboard operation
python-us copied to clipboard

Allow states to have a border attr?

Open askiefer opened this issue 6 years ago • 4 comments

Just ran into this case and wondering if it might be useful to others -

It might be handy to add a borders method on the state object that returns a list of states that border the state, e.g. <State:California>.borders (or another more appropriate method name) would return [<State:Nevada>, <State:Oregon>, <State:Arizona>]. For now I'll have to do a geospatial query to find the bordering states but it might be computationally expensive

askiefer avatar Nov 07 '18 01:11 askiefer

I think this concept would fit in well with the package, given that it's time-insensitive geopolitical metadata about the states, that has practical programmatic uses.

borders as a property name could make sense in my mind, although it may be slightly confusing for international boundaries (what would the property contain for states bordering Canada, Mexico, or the British Virgin Islands?). Maybe using neighbors or the something else would imply that this only refers to other US states? But that's probably bike-shedding by me, and getting this information into the package under borders would be great.

@jcarbaugh, thoughts?

mileswwatkins avatar Jan 27 '19 02:01 mileswwatkins

I'm totally into this idea. neighbors feels like the right attribute for this. @askiefer would you be able to do the queries to get the data for this or find another source for it?

jcarbaugh avatar Jan 27 '19 20:01 jcarbaugh

This is the most academic/official source I could find, but other than being on a university website, there's no reason that it's more authoritative than other sources.

We'll also have to make a call about single-point contact, like Arizona–Colorado; is that neighboring/bordering? I'd be inclined to say "no," but it doesn't seem like there's an authoritative answer.

mileswwatkins avatar Jan 29 '19 16:01 mileswwatkins

So, I think single-point-of-contact should not count as neighbors for our purposes.

But here's another question: what about water-only borders? Should we consider Puerto Rico and the US VI to be neighbors? How about Minnesota and Michigan, Illinois and Michigan, or RI and New York?

My basic thought here is that if a geospatial query against Census shapefiles would identify two entities as neighbors, then they should be considered as such; this would include water-only borders of their territories.

Finally, what should we do about neighbors for the obsolete territories in us? I think we can leave those arrays empty, but happy to be disagreed with here. Otherwise, we'd have an obsolete territory that borders a current-day State, but not vice-versa.

mileswwatkins avatar Apr 10 '19 16:04 mileswwatkins