news: per-article proximate geolocation + GET /api/news/blips
Every graded article now carries best-effort geo on article_scores: - parse_map_scores extracts Location/Lat/Lon/Confidence per block (clamp_coords-validated; Unknown -> no geo; never invent a place) - place-name-only blocks resolve via a vendored offline GeoNames gazetteer (cities15000 + admin1 + country->capital), confidence approx - nullable location_name/lat/lon/location_confidence columns (alembic 014, single head; idempotent ensure_tables mirror) + partial bbox index - GET /api/news/blips: frozen contract, dedup by article id (latest geo wins), finite coords only, created_at DESC, bbox/since/limit, default 1000 max 5000, public read like /api/news/map - critical/high map pins, ticker, grading thresholds, dedupe unchanged Tests: 50 new summarizer geo tests (161 total), 18 new blips API contract tests; alembic upgrade heads proven on fresh DBs both start orders; forced batch on test DB yielded 10 non-critical blips with geo. Card: t_bc15eb53
This commit is contained in:
parent
5ea43a3d0b
commit
ca1c73e1a6
16 changed files with 39639 additions and 10 deletions
252
news/summerizer/data/countries.tsv
Normal file
252
news/summerizer/data/countries.tsv
Normal file
|
|
@ -0,0 +1,252 @@
|
|||
AD Andorra Andorra la Vella
|
||||
AE United Arab Emirates Abu Dhabi
|
||||
AF Afghanistan Kabul
|
||||
AG Antigua and Barbuda St. John's
|
||||
AI Anguilla The Valley
|
||||
AL Albania Tirana
|
||||
AM Armenia Yerevan
|
||||
AO Angola Luanda
|
||||
AQ Antarctica
|
||||
AR Argentina Buenos Aires
|
||||
AS American Samoa Pago Pago
|
||||
AT Austria Vienna
|
||||
AU Australia Canberra
|
||||
AW Aruba Oranjestad
|
||||
AX Aland Islands Mariehamn
|
||||
AZ Azerbaijan Baku
|
||||
BA Bosnia and Herzegovina Sarajevo
|
||||
BB Barbados Bridgetown
|
||||
BD Bangladesh Dhaka
|
||||
BE Belgium Brussels
|
||||
BF Burkina Faso Ouagadougou
|
||||
BG Bulgaria Sofia
|
||||
BH Bahrain Manama
|
||||
BI Burundi Gitega
|
||||
BJ Benin Porto-Novo
|
||||
BL Saint Barthelemy Gustavia
|
||||
BM Bermuda Hamilton
|
||||
BN Brunei Bandar Seri Begawan
|
||||
BO Bolivia Sucre
|
||||
BQ Bonaire, Saint Eustatius and Saba
|
||||
BR Brazil Brasilia
|
||||
BS Bahamas Nassau
|
||||
BT Bhutan Thimphu
|
||||
BV Bouvet Island
|
||||
BW Botswana Gaborone
|
||||
BY Belarus Minsk
|
||||
BZ Belize Belmopan
|
||||
CA Canada Ottawa
|
||||
CC Cocos Islands West Island
|
||||
CD Democratic Republic of the Congo Kinshasa
|
||||
CF Central African Republic Bangui
|
||||
CG Republic of the Congo Brazzaville
|
||||
CH Switzerland Bern
|
||||
CI Ivory Coast Yamoussoukro
|
||||
CK Cook Islands Avarua
|
||||
CL Chile Santiago
|
||||
CM Cameroon Yaounde
|
||||
CN China Beijing
|
||||
CO Colombia Bogota
|
||||
CR Costa Rica San Jose
|
||||
CU Cuba Havana
|
||||
CV Cabo Verde Praia
|
||||
CW Curacao Willemstad
|
||||
CX Christmas Island Flying Fish Cove
|
||||
CY Cyprus Nicosia
|
||||
CZ Czechia Prague
|
||||
DE Germany Berlin
|
||||
DJ Djibouti Djibouti
|
||||
DK Denmark Copenhagen
|
||||
DM Dominica Roseau
|
||||
DO Dominican Republic Santo Domingo
|
||||
DZ Algeria Algiers
|
||||
EC Ecuador Quito
|
||||
EE Estonia Tallinn
|
||||
EG Egypt Cairo
|
||||
EH Western Sahara El-Aaiun
|
||||
ER Eritrea Asmara
|
||||
ES Spain Madrid
|
||||
ET Ethiopia Addis Ababa
|
||||
FI Finland Helsinki
|
||||
FJ Fiji Suva
|
||||
FK Falkland Islands Stanley
|
||||
FM Micronesia Palikir
|
||||
FO Faroe Islands Torshavn
|
||||
FR France Paris
|
||||
GA Gabon Libreville
|
||||
GB United Kingdom London
|
||||
GD Grenada St. George's
|
||||
GE Georgia Tbilisi
|
||||
GF French Guiana Cayenne
|
||||
GG Guernsey St Peter Port
|
||||
GH Ghana Accra
|
||||
GI Gibraltar Gibraltar
|
||||
GL Greenland Nuuk
|
||||
GM Gambia Banjul
|
||||
GN Guinea Conakry
|
||||
GP Guadeloupe Basse-Terre
|
||||
GQ Equatorial Guinea Ciudad de la Paz
|
||||
GR Greece Athens
|
||||
GS South Georgia and the South Sandwich Islands Grytviken
|
||||
GT Guatemala Guatemala City
|
||||
GU Guam Hagatna
|
||||
GW Guinea-Bissau Bissau
|
||||
GY Guyana Georgetown
|
||||
HK Hong Kong Hong Kong
|
||||
HM Heard Island and McDonald Islands
|
||||
HN Honduras Tegucigalpa
|
||||
HR Croatia Zagreb
|
||||
HT Haiti Port-au-Prince
|
||||
HU Hungary Budapest
|
||||
ID Indonesia Jakarta
|
||||
IE Ireland Dublin
|
||||
IL Israel Jerusalem
|
||||
IM Isle of Man Douglas
|
||||
IN India New Delhi
|
||||
IO British Indian Ocean Territory Diego Garcia
|
||||
IQ Iraq Baghdad
|
||||
IR Iran Tehran
|
||||
IS Iceland Reykjavik
|
||||
IT Italy Rome
|
||||
JE Jersey Saint Helier
|
||||
JM Jamaica Kingston
|
||||
JO Jordan Amman
|
||||
JP Japan Tokyo
|
||||
KE Kenya Nairobi
|
||||
KG Kyrgyzstan Bishkek
|
||||
KH Cambodia Phnom Penh
|
||||
KI Kiribati Tarawa
|
||||
KM Comoros Moroni
|
||||
KN Saint Kitts and Nevis Basseterre
|
||||
KP North Korea Pyongyang
|
||||
KR South Korea Seoul
|
||||
XK Kosovo Pristina
|
||||
KW Kuwait Kuwait City
|
||||
KY Cayman Islands George Town
|
||||
KZ Kazakhstan Nur-Sultan
|
||||
LA Laos Vientiane
|
||||
LB Lebanon Beirut
|
||||
LC Saint Lucia Castries
|
||||
LI Liechtenstein Vaduz
|
||||
LK Sri Lanka Colombo
|
||||
LR Liberia Monrovia
|
||||
LS Lesotho Maseru
|
||||
LT Lithuania Vilnius
|
||||
LU Luxembourg Luxembourg
|
||||
LV Latvia Riga
|
||||
LY Libya Tripoli
|
||||
MA Morocco Rabat
|
||||
MC Monaco Monaco
|
||||
MD Moldova Chisinau
|
||||
ME Montenegro Podgorica
|
||||
MF Saint Martin Marigot
|
||||
MG Madagascar Antananarivo
|
||||
MH Marshall Islands Majuro
|
||||
MK North Macedonia Skopje
|
||||
ML Mali Bamako
|
||||
MM Myanmar Nay Pyi Taw
|
||||
MN Mongolia Ulaanbaatar
|
||||
MO Macao Macao
|
||||
MP Northern Mariana Islands Saipan
|
||||
MQ Martinique Fort-de-France
|
||||
MR Mauritania Nouakchott
|
||||
MS Montserrat Plymouth
|
||||
MT Malta Valletta
|
||||
MU Mauritius Port Louis
|
||||
MV Maldives Male
|
||||
MW Malawi Lilongwe
|
||||
MX Mexico Mexico City
|
||||
MY Malaysia Kuala Lumpur
|
||||
MZ Mozambique Maputo
|
||||
NA Namibia Windhoek
|
||||
NC New Caledonia Noumea
|
||||
NE Niger Niamey
|
||||
NF Norfolk Island Kingston
|
||||
NG Nigeria Abuja
|
||||
NI Nicaragua Managua
|
||||
NL The Netherlands Amsterdam
|
||||
NO Norway Oslo
|
||||
NP Nepal Kathmandu
|
||||
NR Nauru Yaren
|
||||
NU Niue Alofi
|
||||
NZ New Zealand Wellington
|
||||
OM Oman Muscat
|
||||
PA Panama Panama City
|
||||
PE Peru Lima
|
||||
PF French Polynesia Papeete
|
||||
PG Papua New Guinea Port Moresby
|
||||
PH Philippines Manila
|
||||
PK Pakistan Islamabad
|
||||
PL Poland Warsaw
|
||||
PM Saint Pierre and Miquelon Saint-Pierre
|
||||
PN Pitcairn Adamstown
|
||||
PR Puerto Rico San Juan
|
||||
PS Palestinian Territory East Jerusalem
|
||||
PT Portugal Lisbon
|
||||
PW Palau Melekeok
|
||||
PY Paraguay Asuncion
|
||||
QA Qatar Doha
|
||||
RE Reunion Saint-Denis
|
||||
RO Romania Bucharest
|
||||
RS Serbia Belgrade
|
||||
RU Russia Moscow
|
||||
RW Rwanda Kigali
|
||||
SA Saudi Arabia Riyadh
|
||||
SB Solomon Islands Honiara
|
||||
SC Seychelles Victoria
|
||||
SD Sudan Khartoum
|
||||
SS South Sudan Juba
|
||||
SE Sweden Stockholm
|
||||
SG Singapore Singapore
|
||||
SH Saint Helena Jamestown
|
||||
SI Slovenia Ljubljana
|
||||
SJ Svalbard and Jan Mayen Longyearbyen
|
||||
SK Slovakia Bratislava
|
||||
SL Sierra Leone Freetown
|
||||
SM San Marino San Marino
|
||||
SN Senegal Dakar
|
||||
SO Somalia Mogadishu
|
||||
SR Suriname Paramaribo
|
||||
ST Sao Tome and Principe Sao Tome
|
||||
SV El Salvador San Salvador
|
||||
SX Sint Maarten Philipsburg
|
||||
SY Syria Damascus
|
||||
SZ Eswatini Mbabane
|
||||
TC Turks and Caicos Islands Cockburn Town
|
||||
TD Chad N'Djamena
|
||||
TF French Southern Territories Port-aux-Francais
|
||||
TG Togo Lome
|
||||
TH Thailand Bangkok
|
||||
TJ Tajikistan Dushanbe
|
||||
TK Tokelau
|
||||
TL Timor Leste Dili
|
||||
TM Turkmenistan Ashgabat
|
||||
TN Tunisia Tunis
|
||||
TO Tonga Nuku'alofa
|
||||
TR Turkey Ankara
|
||||
TT Trinidad and Tobago Port of Spain
|
||||
TV Tuvalu Funafuti
|
||||
TW Taiwan Taipei
|
||||
TZ Tanzania Dodoma
|
||||
UA Ukraine Kyiv
|
||||
UG Uganda Kampala
|
||||
UM United States Minor Outlying Islands
|
||||
US United States Washington
|
||||
UY Uruguay Montevideo
|
||||
UZ Uzbekistan Tashkent
|
||||
VA Vatican Vatican City
|
||||
VC Saint Vincent and the Grenadines Kingstown
|
||||
VE Venezuela Caracas
|
||||
VG British Virgin Islands Road Town
|
||||
VI U.S. Virgin Islands Charlotte Amalie
|
||||
VN Vietnam Hanoi
|
||||
VU Vanuatu Port Vila
|
||||
WF Wallis and Futuna Mata Utu
|
||||
WS Samoa Apia
|
||||
YE Yemen Sanaa
|
||||
YT Mayotte Mamoudzou
|
||||
ZA South Africa Pretoria
|
||||
ZM Zambia Lusaka
|
||||
ZW Zimbabwe Harare
|
||||
CS Serbia and Montenegro Belgrade
|
||||
AN Netherlands Antilles Willemstad
|
||||
|
Loading…
Reference in a new issue