Skip to content

Commit

Permalink
timezone fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Apr 13, 2020
1 parent 3669f8c commit a1d0f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion country_levels_lib/wam/wam_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

population_map = None
population_fixes = read_json(fixes_dir / 'population.json')
timezone_fixes = read_json(fixes_dir / 'timezone.json')
skip_osm_features = {int(i) for i in read_json(fixes_dir / 'skip_osm.json')}
us_states_by_postal = fips_utils.get_state_data()[1]

Expand Down Expand Up @@ -80,7 +81,9 @@ def process_feature_properties(feature: dict, iso_level: int):
if not timezone:
timezone = find_timezone(centroid['lon'], centroid['lat'])
if not timezone:
print(f'missing timezone for {iso} {name}')
timezone = timezone_fixes.get(countrylevel_id)
if not timezone:
print(f'missing timezone for {countrylevel_id} {name}')

# override population for US states from Census data
if iso.startswith('US-'):
Expand Down
5 changes: 5 additions & 0 deletions fixes/timezone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"iso1:MY": "Asia/Kuala_Lumpur",
"iso2:PT-30": "Atlantic/Madeira",
"iso2:JP-47": "Asia/Tokyo"
}

0 comments on commit a1d0f01

Please sign in to comment.