Add SPC map city list
This commit is contained in:
parent
330117dea5
commit
1552bd6242
1 changed files with 71 additions and 1 deletions
|
@ -4,8 +4,9 @@ import shapely
|
||||||
import datetime
|
import datetime
|
||||||
import cairo
|
import cairo
|
||||||
|
|
||||||
from xmet.db import DatabaseTable
|
from xmet.db import Database, DatabaseTable
|
||||||
from xmet.coord import COORD_SYSTEM
|
from xmet.coord import COORD_SYSTEM
|
||||||
|
from xmet.city import City
|
||||||
from xmet.map import EquirectMap, MAP_SCREEN_DIMENSIONS, MAP_BOUNDS
|
from xmet.map import EquirectMap, MAP_SCREEN_DIMENSIONS, MAP_BOUNDS
|
||||||
from xmet.afos import MONTHS, TIMEZONES
|
from xmet.afos import MONTHS, TIMEZONES
|
||||||
|
|
||||||
|
@ -62,6 +63,60 @@ RE_POINTS_START = re.compile(r'''
|
||||||
|
|
||||||
RE_POINTS = re.compile(r'^(?:\s+\d{8}){1,6}$')
|
RE_POINTS = re.compile(r'^(?:\s+\d{8}){1,6}$')
|
||||||
|
|
||||||
|
CITIES = {
|
||||||
|
'WA': ('Seattle', 'Spokane'),
|
||||||
|
'OR': ('Portland', 'Eugene', 'Medford'),
|
||||||
|
'CA': (
|
||||||
|
'Redding', 'Sacramento', 'San Francisco', 'Fresno', 'Santa Barbara',
|
||||||
|
'Los Angeles', 'San Diego'
|
||||||
|
),
|
||||||
|
'ID': ('Boise', 'Pocatello'),
|
||||||
|
'NV': ('Elko', 'Reno', 'Las Vegas'),
|
||||||
|
'UT': ('Salt Lake City', 'Cedar City'),
|
||||||
|
'AZ': ('Flagstaff', 'Phoenix', 'Tucson'),
|
||||||
|
'MT': ('Great Falls', 'Missoula', 'Butte', 'Billings'),
|
||||||
|
'WY': ('Sheridan', 'Jackson', 'Casper', 'Cheyenne'),
|
||||||
|
'CO': ('Denver', 'Grand Junction', 'Pueblo', 'Durango'),
|
||||||
|
'NM': ('Santa Fe', 'Albuquerque', 'Las Cruces'),
|
||||||
|
'ND': ('Minot', 'Bismarck', 'Fargo', 'Grand Forks'),
|
||||||
|
'SD': ('Aberdeen', 'Pierre', 'Rapid City', 'Sioux Falls'),
|
||||||
|
'NE': ('Omaha', 'Lincoln', 'McCook', 'Norfolk'),
|
||||||
|
'KS': ('Wichita', 'Colby', 'Liberal', 'Garden City'),
|
||||||
|
'OK': ('Woodward', 'Tulsa', 'Oklahoma City', 'Norman', 'Altus'),
|
||||||
|
'TX': (
|
||||||
|
'Amarillo', 'Wichita Falls', 'Lubbock', 'Dallas', 'Abilene',
|
||||||
|
'Midland', 'Waco', 'Austin', 'San Antonio', 'Houston',
|
||||||
|
'Corpus Christi', 'Brownsville'
|
||||||
|
),
|
||||||
|
'LA': ('Shreveport', 'New Orleans', 'Alexandria',),
|
||||||
|
'AR': ('Little Rock', 'Bentonville'),
|
||||||
|
'MO': ('Jefferson City', 'Kansas City'),
|
||||||
|
'IA': ('Des Moines',),
|
||||||
|
'MN': ('Minneapolis', 'Duluth'),
|
||||||
|
'MI': ('Marquette', 'Detroit'),
|
||||||
|
'WI': ('Green Bay', 'Milwaukee'),
|
||||||
|
'IL': ('Chicago', 'Peoria', 'Springfield'),
|
||||||
|
'KY': ('Louisville', 'Paducah', 'Bowling Green'),
|
||||||
|
'TN': ('Nashville', 'Jackson', 'Memphis'),
|
||||||
|
'MS': ('Jackson',),
|
||||||
|
'AL': ('Tuscaloosa', 'Mobile'),
|
||||||
|
'GA': ('Atlanta', 'Columbus'),
|
||||||
|
'FL': ('Tallahassee', 'Jacksonville', 'Orlando', 'Tampa', 'Miami'),
|
||||||
|
'SC': ('Columbia', 'Charleston'),
|
||||||
|
'NC': ('Charlotte', 'Raleigh', 'Wilmington'),
|
||||||
|
'VA': ('Roanoke', 'Richmond'),
|
||||||
|
'WV': ('Charleston',),
|
||||||
|
'DC': ('Washington',),
|
||||||
|
'MD': ('Baltimore',),
|
||||||
|
'OH': ('Columbus', 'Cincinnati'),
|
||||||
|
'IN': ('Fort Wayne', 'Indianapolis'),
|
||||||
|
'PA': ('Philadelphia', 'Pittsburgh', 'Scranton'),
|
||||||
|
'NY': ('Rochester', 'Buffalo', 'New York'),
|
||||||
|
'VT': ('Burlington',),
|
||||||
|
'ME': ('Portland',),
|
||||||
|
'MA': ('Boston',)
|
||||||
|
}
|
||||||
|
|
||||||
class SPCOutlookParserException(Exception):
|
class SPCOutlookParserException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -601,3 +656,18 @@ class SPCOutlookMap(EquirectMap):
|
||||||
cr.stroke()
|
cr.stroke()
|
||||||
|
|
||||||
cr.restore()
|
cr.restore()
|
||||||
|
|
||||||
|
def draw_cities(self,
|
||||||
|
cr: cairo.Context,
|
||||||
|
db: Database):
|
||||||
|
for state in CITIES:
|
||||||
|
for name in CITIES[state]:
|
||||||
|
city = db.get(City, {
|
||||||
|
'name': name,
|
||||||
|
'state': state
|
||||||
|
})
|
||||||
|
|
||||||
|
if city is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.draw_city(cr, city)
|
||||||
|
|
Loading…
Add table
Reference in a new issue