Answer prose round 1: the sources name Wikidata, the decision title reads in one pass, and the street rule's threshold says why it is five
This commit is contained in:
@@ -90,7 +90,7 @@ In [docs/decisions.md](docs/decisions.md):
|
|||||||
- A path is walked once without drawing before it is walked for real
|
- A path is walked once without drawing before it is walked for real
|
||||||
- A country's postal codes and streets are siblings under its locality
|
- A country's postal codes and streets are siblings under its locality
|
||||||
- A locale package imports its country's geo package, and its `Modules()` returns both
|
- A locale package imports its country's geo package, and its `Modules()` returns both
|
||||||
- The default embed holds every Swedish postort the import can place with all its streets, and of the US places that hold most of a postal code's land a population-weighted tenth, every state capital and every place of 100,000, each with a quarter of its streets, at least ten
|
- The default embed holds every Swedish postort the import can place, with all its streets, and, of the US places that hold most of a postal code's land, every state capital, every place of 100,000 or more and a population-weighted tenth, each with a quarter of its streets, at least ten
|
||||||
- A locale's `address` binds its country's record once and prints it whole
|
- A locale's `address` binds its country's record once and prints it whole
|
||||||
- A postort's kommun comes from its name, its tätort or its codes, never from distance
|
- A postort's kommun comes from its name, its tätort or its codes, never from distance
|
||||||
- A highway designation is not a street, and a US postal code belongs to the place holding most of its land inside places
|
- A highway designation is not a street, and a US postal code belongs to the place holding most of its land inside places
|
||||||
|
|||||||
+4
-4
@@ -89,15 +89,15 @@ replacement, and each removed path, column or flag.
|
|||||||
either, with the `severity` RFC 5424 spells beside it.
|
either, with the `severity` RFC 5424 spells beside it.
|
||||||
- `geo.SE` and `geo.US`: five linked tables per country, `region`, `municipality`,
|
- `geo.SE` and `geo.US`: five linked tables per country, `region`, `municipality`,
|
||||||
`locality`, `postal-code` and `street`, weighted by population and address counts
|
`locality`, `postal-code` and `street`, weighted by population and address counts
|
||||||
and built from SCB, GeoNames, Trafikverket NVDB and the US Census Bureau, and an
|
and built from SCB, GeoNames, Trafikverket NVDB, the US Census Bureau and Wikidata, and an
|
||||||
`address` record binding one locality and drawing its street and postal code inside
|
`address` record binding one locality and drawing its street and postal code inside
|
||||||
it. `sv_SE.address` and `en_US.address` bind those records once, so
|
it. `sv_SE.address` and `en_US.address` bind those records once, so
|
||||||
`en_US.address.street` no longer carries `name` and `suffix`, and a locale's `address`
|
`en_US.address.street` no longer carries `name` and `suffix`, and a locale's `address`
|
||||||
reads its country's `geo` module. Every Swedish postort the import can place and give
|
reads its country's `geo` module. Every Swedish postort the import can place and give
|
||||||
a street ships with all its streets. Of the US incorporated places that hold most of
|
a street ships with all its streets. Of the US incorporated places that hold most of
|
||||||
some postal code's land, a tenth drawn by population down to villages of a hundred
|
some postal code's land, a tenth ships, drawn by population down to villages of a
|
||||||
people ships, plus every state capital but Honolulu and every place of 100,000 or more,
|
hundred people, and so do every state capital but Honolulu and every place of 100,000
|
||||||
so a smaller city may be missing; each carries a quarter of its streets, at
|
or more. A smaller city may be missing. Each place carries a quarter of its streets, at
|
||||||
least ten.
|
least ten.
|
||||||
- `{date(from,to,'layout')}` and `{time('layout')}`: a second between two days, or
|
- `{date(from,to,'layout')}` and `{time('layout')}`: a second between two days, or
|
||||||
within one, in a single-quoted Go layout, drawn in UTC; `from` may equal `to`.
|
within one, in a single-quoted Go layout, drawn in UTC; `from` may equal `to`.
|
||||||
|
|||||||
@@ -313,14 +313,14 @@ neighbouring one.
|
|||||||
| `municipality` | kommun, by code or name | county, by FIPS code or name | population |
|
| `municipality` | kommun, by code or name | county, by FIPS code or name | population |
|
||||||
| `locality` | postort, by name; [`geo-se.py`](data-import/geo-se.py)'s `localities` picks the candidates, and one with no street is dropped | incorporated place, 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; [`geo-se.py`](data-import/geo-se.py)'s `localities` picks the candidates, and one with no street is dropped | incorporated place, 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 |
|
| `postal-code` | postnummer with street delivery, by code | ZCTA, by code | one; address ranges |
|
||||||
| `street` | gatunamn, every one; [`geo-se.py`](data-import/geo-se.py)'s `street_name` drops a name that is not a street's | street name, per place the quarter with most address ranges, at least ten | segments; address ranges |
|
| `street` | gatunamn, every one [`geo-se.py`](data-import/geo-se.py)'s `street_name` accepts | street name, per place the quarter with most address ranges, at least ten | segments; address ranges |
|
||||||
|
|
||||||
`geo.SE.region[Skåne län].municipality` draws a kommun in Skåne,
|
`geo.SE.region[Skåne län].municipality` draws a kommun in Skåne,
|
||||||
`geo.SE.locality[Lund].street` a street in Lund, and
|
`geo.SE.locality[Lund].street` a street in Lund, and
|
||||||
`geo.US.region[IL].locality[Springfield]` settles which Springfield. The US places are
|
`geo.US.region[IL].locality[Springfield]` settles which Springfield. The US places come
|
||||||
the incorporated places that hold most of some postal code's land: a tenth of them, drawn
|
from the incorporated places that hold most of some postal code's land: a tenth of them,
|
||||||
with odds by population, plus every state capital but Honolulu and every place of 100,000
|
drawn with odds by population, every state capital but Honolulu, and every place of
|
||||||
or more, so a smaller city may be missing: look one up in
|
100,000 or more. A smaller city may be missing, so look one up in
|
||||||
[`locality.tsv`](data/geo/US/locality.tsv) before selecting it. A region row
|
[`locality.tsv`](data/geo/US/locality.tsv) before selecting it. A region row
|
||||||
carries its `timezone`, the state's predominant zone, and a locality its `lat` and
|
carries its `timezone`, the state's predominant zone, and a locality its `lat` and
|
||||||
`lon`. What ports across countries is the five table names, the `name` column,
|
`lon`. What ports across countries is the five table names, the `name` column,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ TIMEZONE = "Europe/Stockholm"
|
|||||||
ONE_POSITION = {"Stockholm", "Göteborg", "Malmö"}
|
ONE_POSITION = {"Stockholm", "Göteborg", "Malmö"}
|
||||||
# A tätort's floor: "minst 200 invånare", docs/research/research-geo-se.md, Lantmäteriet → Ortnamn.
|
# A tätort's floor: "minst 200 invånare", docs/research/research-geo-se.md, Lantmäteriet → Ortnamn.
|
||||||
UNMATCHED_POPULATION = 200
|
UNMATCHED_POPULATION = 200
|
||||||
# Not a street: a road number, a ferry route, a cycle path or road association's label, a placeholder, or two names
|
# Not a street: a road number, a ferry route, a cycle path's or road association's label, a placeholder, or two names
|
||||||
# or a description in one.
|
# or a description in one.
|
||||||
NOT_A_STREET = re.compile(r"^(Europaväg|Länsväg|Riksväg) \d|^Färjeled |\b(GC|SMF|VSF)\b|^NN$|,")
|
NOT_A_STREET = re.compile(r"^(Europaväg|Länsväg|Riksväg) \d|^Färjeled |\b(GC|SMF|VSF)\b|^NN$|,")
|
||||||
PARTICLES = {"af", "de", "von"}
|
PARTICLES = {"af", "de", "von"}
|
||||||
@@ -166,7 +166,7 @@ def localities(codes, tatorter, municipalities, population):
|
|||||||
|
|
||||||
|
|
||||||
def street_name(name):
|
def street_name(name):
|
||||||
"""Whether name is a street's, opening with a capital or a nobiliary particle and with no word spelled in capitals."""
|
# A word of four capitals or fewer is an acronym or a Roman numeral: IOGT-vägen, Karl XII gatan.
|
||||||
opening = name[0].isupper() or name.split()[0] in PARTICLES
|
opening = name[0].isupper() or name.split()[0] in PARTICLES
|
||||||
return opening and not NOT_A_STREET.search(name) and not any(len(w) >= 5 and w.isupper() for w in name.split())
|
return opening and not NOT_A_STREET.search(name) and not any(len(w) >= 5 and w.isupper() for w in name.split())
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Rebuild data/geo/US/*.tsv from the Census Bureau's Gazetteer, population estimates, ZCTA relationships and TIGER/Line files (public domain).
|
"""Rebuild data/geo/US/*.tsv from the Census Bureau's Gazetteer, population estimates, ZCTA relationships and TIGER/Line files (public domain), and Wikidata's state capitals (CC0).
|
||||||
|
|
||||||
data-import/geo-us.py [--cache DIR] [--min-streets N] [--place-share F] [--street-share F] [--out DIR]
|
data-import/geo-us.py [--cache DIR] [--min-streets N] [--place-share F] [--street-share F] [--out DIR]
|
||||||
"""
|
"""
|
||||||
|
|||||||
+1
-2
@@ -376,8 +376,7 @@ func TestShippedAddressIsOneNamedPick(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestShippedPlacesSpreadAddresses pins that Göteborg ships 1,500 streets or more, Los
|
// 0644000 is Los Angeles.
|
||||||
// Angeles 2,500 or more, and that some US place holds under 2,500 people.
|
|
||||||
func TestShippedPlacesSpreadAddresses(t *testing.T) {
|
func TestShippedPlacesSpreadAddresses(t *testing.T) {
|
||||||
for country, city := range map[string]struct {
|
for country, city := range map[string]struct {
|
||||||
key string
|
key string
|
||||||
|
|||||||
+3
-3
@@ -603,7 +603,7 @@ providing `geo.SE`'s paths, and without one `sv_SE.address` fails at first reach
|
|||||||
`FS` works against goal 6.2. Every package exports `Modules()`, so one spelling loads any of
|
`FS` works against goal 6.2. Every package exports `Modules()`, so one spelling loads any of
|
||||||
them; a data package imports only the packages it reads.
|
them; a data package imports only the packages it reads.
|
||||||
|
|
||||||
## The default embed holds every Swedish postort the import can place with all its streets, and of the US places that hold most of a postal code's land a population-weighted tenth, every state capital and every place of 100,000, each with a quarter of its streets, at least ten
|
## The default embed holds every Swedish postort the import can place, with all its streets, and, of the US places that hold most of a postal code's land, every state capital, every place of 100,000 or more and a population-weighted tenth, each with a quarter of its streets, at least ten
|
||||||
|
|
||||||
2026-10-11, Lilleman auf Larv; revised the same day, after a tenth of the streets gave
|
2026-10-11, Lilleman auf Larv; revised the same day, after a tenth of the streets gave
|
||||||
Göteborg 163 and Stockholm 37. Goals 2 and 14: ten streets per place put 500 Stockholm
|
Göteborg 163 and Stockholm 37. Goals 2 and 14: ten streets per place put 500 Stockholm
|
||||||
@@ -612,8 +612,8 @@ village. `geo-us.py` draws with Efraimidis and Spirakis's weighted sampling. It
|
|||||||
only among places holding most of some ZCTA's land, since no other place can carry a
|
only among places holding most of some ZCTA's land, since no other place can carry a
|
||||||
postal code. The draw alone kept 310 of the 343 places of 100,000 or more and left out
|
postal code. The draw alone kept 310 of the 343 places of 100,000 or more and left out
|
||||||
13 state capitals, so a test author pinning a city they know hit `no row of … has key
|
13 state capitals, so a test author pinning a city they know hit `no row of … has key
|
||||||
or name`; every capital and every place of 100,000 now ships beside the draw, and its
|
or name`; every capital and every place of 100,000 or more ships beside the draw. The
|
||||||
smallest place holds 93 people. The capitals are each state's `capital` (P36) in
|
draw's smallest place holds 93 people. The capitals are each state's `capital` (P36) in
|
||||||
[Wikidata](https://www.wikidata.org/), matched to a Census place by its GNIS id and
|
[Wikidata](https://www.wikidata.org/), matched to a Census place by its GNIS id and
|
||||||
else by a name no other place in its state carries. No census-designated place ships,
|
else by a name no other place in its state carries. No census-designated place ships,
|
||||||
so Honolulu is the one capital missing. Every Swedish street is 174k rows; a quarter
|
so Honolulu is the one capital missing. Every Swedish street is 174k rows; a quarter
|
||||||
|
|||||||
Reference in New Issue
Block a user