Compare commits
2 Commits
6adc086b7e
...
b6219bf76a
| Author | SHA1 | Date | |
|---|---|---|---|
| b6219bf76a | |||
| e5711cbdb4 |
@@ -236,7 +236,7 @@ consistent draw of them, which the locale's `address` reads.
|
||||
|-------|----------|----------|--------|
|
||||
| `region` | län, by code or name | state, by USPS abbreviation or name; `code` is the FIPS code | population |
|
||||
| `municipality` | kommun, by code or name | county, by FIPS code or name | population |
|
||||
| `locality` | postort, by name | incorporated place of 25,000 people or more, by GEOID or name; Hawaii has none | tätort population, the kommun's where the postort names it, else 200; place population |
|
||||
| `locality` | postort, by name | incorporated place of 25,000 people or more with a postal code of its own, by GEOID or name; Hawaii has none | tätort population, the kommun's where the postort names it, else 200; place population |
|
||||
| `postal-code` | postnummer with street delivery, by code | ZCTA, by code | one; address ranges |
|
||||
| `street` | gatunamn, the ten with most road segments per postort | street name, the ten with most address ranges per place | segments; address ranges |
|
||||
|
||||
@@ -1035,9 +1035,11 @@ renamed or retyped line is a major.
|
||||
holding most of its land inside places.** `I- 55 Bus` and `US Hwy 1` carry the
|
||||
most address ranges in many places and would head every address, so the import
|
||||
drops names spelled as a route. A ZCTA goes to the place its largest in-place part
|
||||
lies in, and ships only when that place does; counting the land outside every
|
||||
place too would drop a quarter of the places, whose codes straddle unincorporated
|
||||
land, for a postal city the USPS mostly names the same way.
|
||||
lies in, census-designated places left out since they never ship, and ships only
|
||||
when that place does, so a few dozen places whose every code lies mostly in a
|
||||
bigger neighbour ship no address; counting the land outside every place too would
|
||||
drop a quarter of the places, whose codes straddle unincorporated land, for a
|
||||
postal city the USPS mostly names the same way.
|
||||
- **`List` advertises direct descents only.** `region.municipality.locality` is
|
||||
listed, and `region.locality` resolves too but is not: the set of every descent
|
||||
through a chain of five tables is every subsequence of it, and the direct chain is
|
||||
|
||||
@@ -27,7 +27,7 @@ OUT = Path(__file__).resolve().parent.parent / "data" / "geo" / "US"
|
||||
CACHE = Path(__file__).resolve().parent / "cache"
|
||||
ESTIMATE = "POPESTIMATE2025"
|
||||
CDP = "57"
|
||||
HIGHWAY = re.compile(r"\b(I- |Hwy |Rte |Route |Rd )\d")
|
||||
HIGHWAY = re.compile(r"\b(I- |Hwy |Highway |Loop |Rte |Route |Rd )\d")
|
||||
SUFFIX = re.compile(r" (city and borough|city|town|village|borough|municipality|comunidad|zona urbana|metropolitan government|metro government|consolidated government|unified government|urban county|corporation|plantation)( \(balance\))?$")
|
||||
# Places whose Census name is a merged government's; the postal city is what an address carries.
|
||||
NAMES = {"1303440": "Athens", "1304204": "Augusta", "1349008": "Macon", "2148006": "Louisville", "3011397": "Butte", "4732742": "Hartsville", "4752006": "Nashville"}
|
||||
@@ -128,10 +128,10 @@ def localities(cache, min_population, counties):
|
||||
|
||||
|
||||
def postal_codes(cache, localities):
|
||||
"""Each ZCTA whose largest part inside any place lies in a shipped place."""
|
||||
"""Each ZCTA whose largest part inside an incorporated place lies in a shipped place."""
|
||||
parts = {}
|
||||
for r in csv.DictReader(io.StringIO(text(tsv.fetch(ZCTA_PLACE, cache, "zcta-place.txt"))), delimiter="|"):
|
||||
if r["GEOID_ZCTA5_20"] and r["GEOID_PLACE_20"]:
|
||||
if r["GEOID_ZCTA5_20"] and r["GEOID_PLACE_20"] and not r["NAMELSAD_PLACE_20"].endswith(" CDP"):
|
||||
parts.setdefault(r["GEOID_ZCTA5_20"], []).append((int(r["AREALAND_PART"]), r["GEOID_PLACE_20"]))
|
||||
largest = {zcta: max(p)[1] for zcta, p in parts.items()}
|
||||
return {zcta: place for zcta, place in largest.items() if place in localities}
|
||||
|
||||
@@ -224,7 +224,7 @@ code name municipality population lat lon
|
||||
0648914 Monterey Park 06037 57457 34.04838 -118.133165
|
||||
0649138 Moorpark 06111 35023 34.285942 -118.87704
|
||||
0649270 Moreno Valley 06065 214263 33.923253 -117.205685
|
||||
0649582 Mountain House 06077 25315 37.779716 -121.537195
|
||||
0649278 Morgan Hill 06085 45625 37.132495 -121.641891
|
||||
0649670 Mountain View 06085 85438 37.399686 -122.079269
|
||||
0650076 Murrieta 06065 114124 33.573214 -117.191007
|
||||
0650258 Napa 06055 76562 38.297118 -122.301008
|
||||
@@ -287,6 +287,7 @@ code name municipality population lat lon
|
||||
0666070 San Dimas 06037 32978 34.107957 -117.808529
|
||||
0667000 San Francisco 06075 826079 37.727239 -123.032229
|
||||
0667042 San Gabriel 06037 38186 34.094636 -118.098469
|
||||
0667056 Sanger 06019 27228 36.700864 -119.55773
|
||||
0667112 San Jacinto 06065 56014 33.798864 -116.995914
|
||||
0668000 San Jose 06085 989814 37.296011 -121.814552
|
||||
0668028 San Juan Capistrano 06059 35119 33.500889 -117.654388
|
||||
@@ -495,6 +496,7 @@ code name municipality population lat lon
|
||||
1276500 West Melbourne 12009 31285 28.050398 -80.658327
|
||||
1276582 Weston 12011 69588 26.100076 -80.401266
|
||||
1276600 West Palm Beach 12099 127189 26.745114 -80.127038
|
||||
1278250 Winter Garden 12095 48063 28.541217 -81.597043
|
||||
1278275 Winter Haven 12105 62313 28.045836 -81.732743
|
||||
1278300 Winter Park 12095 30444 28.59663 -81.345748
|
||||
1278325 Winter Springs 12117 39585 28.695481 -81.272086
|
||||
@@ -521,7 +523,6 @@ code name municipality population lat lon
|
||||
1343192 Kennesaw 13067 37970 34.031195 -84.621287
|
||||
1344340 LaGrange 13285 34730 33.02698 -85.038261
|
||||
1345488 Lawrenceville 13135 32822 33.952875 -83.992231
|
||||
1348288 Mableton 13067 78820 33.812998 -84.576946
|
||||
1348624 McDonough 13151 33395 33.439611 -84.148899
|
||||
1349008 Macon 13021 157556 32.808995 -83.694051
|
||||
1349756 Marietta 13067 63574 33.953561 -84.542463
|
||||
@@ -757,6 +758,7 @@ code name municipality population lat lon
|
||||
2338740 Lewiston 23001 38866 44.089325 -70.172051
|
||||
2360545 Portland 23005 69911 43.633157 -70.185305
|
||||
2371990 South Portland 23005 27007 43.631402 -70.285989
|
||||
2401600 Annapolis 24003 40634 38.97216 -76.505334
|
||||
2404000 Baltimore 24510 569997 39.300061 -76.610518
|
||||
2408775 Bowie 24033 58383 38.954703 -76.738834
|
||||
2418750 College Park 24033 35418 38.996692 -76.936407
|
||||
@@ -1037,6 +1039,7 @@ code name municipality population lat lon
|
||||
3643335 Long Beach 36059 34918 40.585835 -73.665403
|
||||
3647042 Middletown 36071 30098 41.444922 -74.423573
|
||||
3649121 Mount Vernon 36119 72304 40.913105 -73.829317
|
||||
3650034 Newburgh 36071 28059 41.503249 -74.01964
|
||||
3650617 New Rochelle 36119 85864 40.923243 -73.779344
|
||||
3651000 New York 36047 8584629 40.662712 -73.938677
|
||||
3651055 Niagara Falls 36063 47255 43.092841 -79.014743
|
||||
@@ -1472,6 +1475,7 @@ code name municipality population lat lon
|
||||
5114968 Charlottesville 51540 44388 38.037658 -78.485381
|
||||
5116000 Chesapeake 51550 255332 36.679376 -76.301788
|
||||
5121344 Danville 51590 41647 36.581754 -79.408258
|
||||
5126496 Fairfax 51600 26772 38.853183 -77.299025
|
||||
5129744 Fredericksburg 51630 30393 38.299272 -77.486658
|
||||
5135000 Hampton 51650 137315 37.047961 -76.297293
|
||||
5135624 Harrisonburg 51660 50839 38.436255 -78.873303
|
||||
@@ -1510,6 +1514,7 @@ code name municipality population lat lon
|
||||
5338038 Lakewood 53053 62755 47.164092 -122.528106
|
||||
5340245 Longview 53015 38362 46.145707 -122.964299
|
||||
5340840 Lynnwood 53061 42132 47.828979 -122.300672
|
||||
5343150 Maple Valley 53033 28482 47.367147 -122.034815
|
||||
5343955 Marysville 53061 77686 48.080214 -122.154312
|
||||
5345005 Mercer Island 53033 25422 47.564004 -122.231214
|
||||
5347245 Moses Lake 53025 27469 47.12785 -119.276384
|
||||
|
||||
|
@@ -255,6 +255,7 @@ code name region population
|
||||
23001 Androscoggin County ME 116487
|
||||
23005 Cumberland County ME 317222
|
||||
23019 Penobscot County ME 157967
|
||||
24003 Anne Arundel County MD 603380
|
||||
24021 Frederick County MD 302883
|
||||
24031 Montgomery County MD 1074582
|
||||
24033 Prince George's County MD 970374
|
||||
@@ -601,6 +602,7 @@ code name region population
|
||||
51540 Charlottesville city VA 44388
|
||||
51550 Chesapeake city VA 255332
|
||||
51590 Danville city VA 41647
|
||||
51600 Fairfax city VA 26772
|
||||
51630 Fredericksburg city VA 30393
|
||||
51650 Hampton city VA 137315
|
||||
51660 Harrisonburg city VA 50839
|
||||
|
||||
|
+523
-3
File diff suppressed because it is too large
Load Diff
+1443
-1393
File diff suppressed because it is too large
Load Diff
@@ -54,10 +54,10 @@ countries; the README maps each to the native term.
|
||||
| Table | SE | US | Weight |
|
||||
|---|---|---|---|
|
||||
| `region` | län (21) | state and DC (50; Hawaii has no incorporated place) | population |
|
||||
| `municipality` | kommun (290) | county with a shipped place (663) | population |
|
||||
| `locality` | postort (1,522), tätort population | place of 25,000+ (1,579) | population |
|
||||
| `postal-code` | postnummer with street delivery (13,712) | ZCTA of a shipped place (5,946) | one; address ranges |
|
||||
| `street` | gatunamn, top 10 per postort (14,764) | street name, top 10 per place (15,790) | segments; address ranges |
|
||||
| `municipality` | kommun (290) | county with a shipped place | population |
|
||||
| `locality` | postort, tätort population | place of 25,000+ | population |
|
||||
| `postal-code` | postnummer with street delivery | ZCTA of a shipped place | one; address ranges |
|
||||
| `street` | gatunamn, top 10 per postort | street name, top 10 per place | segments; address ranges |
|
||||
|
||||
- Shipped in step 2, README Data. `geo.SE.address` is a record over one consistent
|
||||
draw. Each region row carries its timezone, each locality its centroid.
|
||||
|
||||
Reference in New Issue
Block a user