Add weather zone hkz000 for Hong Kong Observatory

Thanks to Bill Agee for suggesting the Hong Kong Observatory's
weather forecast page. A custom filter is implemented to strip the
forecast text from the HTML page in which it is embedded (if anyone
finds a plaintext version published at an alternate URL, let me know
and I'll rip out the extra routine).
This commit is contained in:
Jeremy Stanley
2020-05-26 00:04:48 +00:00
parent 8e0d7c6e1a
commit fd4b0ae5b2
8 changed files with 30 additions and 5 deletions

View File

@@ -20,7 +20,7 @@
# ab78f945488371035514fc2c14e4679a 2020-05-24 airports.csv
#
# ...and these manually-generated or hand-compiled adjustments:
# aadcf8801156f29dc5c622bb5e874e88 2020-05-24 overrides.conf
# 298b10d8d6f5a4a41b2eb0c356766427 2020-05-24 overrides.conf
# ab8545489a62124779edf7214a619325 2020-05-24 slist
# 12c84e28cdb6da9eeba12b5a4af034b0 2020-05-24 zlist

View File

@@ -502,6 +502,12 @@ comment = manually researched on 2020-05-24
description = Ismalia, IML, Egypt
location = (0.5339253128236962, 0.5628201985215509)
[hkz000]
description = Hong Kong Observatory
comment = suggested by Bill Agee
centroid = (0.3897902, 1.9928751)
zone_forecast = https://www.hko.gov.hk/textonly/v2/forecast/nday.htm
[hesw]
comment = manually researched on 2020-05-24
description = Siwa Oasis Arpt, Egypt

View File

@@ -1,3 +1,4 @@
added zone hkz000 (+4 options)
changed station cahr (+3 options)
changed station cerm (+3 options)
changed station cmfm (+3 options)

2
places
View File

@@ -20,7 +20,7 @@
# ab78f945488371035514fc2c14e4679a 2020-05-24 airports.csv
#
# ...and these manually-generated or hand-compiled adjustments:
# aadcf8801156f29dc5c622bb5e874e88 2020-05-24 overrides.conf
# 298b10d8d6f5a4a41b2eb0c356766427 2020-05-24 overrides.conf
# ab8545489a62124779edf7214a619325 2020-05-24 slist
# 12c84e28cdb6da9eeba12b5a4af034b0 2020-05-24 zlist

View File

@@ -20,7 +20,7 @@
# ab78f945488371035514fc2c14e4679a 2020-05-24 airports.csv
#
# ...and these manually-generated or hand-compiled adjustments:
# aadcf8801156f29dc5c622bb5e874e88 2020-05-24 overrides.conf
# 298b10d8d6f5a4a41b2eb0c356766427 2020-05-24 overrides.conf
# ab8545489a62124779edf7214a619325 2020-05-24 slist
# 12c84e28cdb6da9eeba12b5a4af034b0 2020-05-24 zlist
@@ -30143,6 +30143,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/VGHS.TXT
description = Hong Kong Inter-National Airport, Hong Kong
location = (0.3897902, 1.9928751)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/VHHH.TXT
zone = ('hkz000', 0.0000000)
[viag]
description = Agra, India
@@ -30243,6 +30244,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/VLVT.TXT
description = Taipa, Macau
location = (0.3868813, 1.9821123)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/VMMC.TXT
zone = ('hkz000', 0.0103775)
[vnkt]
description = Kathmandu Airport, Nepal
@@ -31382,6 +31384,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZBYN.TXT
description = Guangzhou, China
location = (0.4043346, 1.9780398)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGGG.TXT
zone = ('hkz000', 0.0199677)
[zgha]
description = Changsha, China
@@ -31392,6 +31395,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGHA.TXT
description = Guilin, China
location = (0.4421501, 1.9250982)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGKL.TXT
zone = ('hkz000', 0.0811393)
[zgnn]
description = Nanning, China
@@ -31402,11 +31406,13 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGNN.TXT
description = Shantou, China
location = (0.4084070, 2.0365083)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGOW.TXT
zone = ('hkz000', 0.0443041)
[zgsz]
description = Shenzhen, China
location = (0.3935717, 1.9914207)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZGSZ.TXT
zone = ('hkz000', 0.0040134)
[zhcc]
description = Zhengzhou, China
@@ -31422,6 +31428,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZHHH.TXT
description = Haikou Meilan International Airport, Haikou, 46, CN
location = (0.3479296, 1.9278732)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZJHK.TXT
zone = ('hkz000', 0.0736704)
[zjsy]
description = Sanya/Fenghuang, China
@@ -31452,6 +31459,7 @@ metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZPPP.TXT
description = Xiamen, China
location = (0.4273148, 2.0609430)
metar = https://tgftp.nws.noaa.gov/data/observations/metar/decoded/ZSAM.TXT
zone = ('hkz000', 0.0728636)
[zsfz]
description = Fuzhou, China

View File

@@ -238,6 +238,9 @@ def get_uri(
)
sys.stderr.write(message)
sys.exit(1)
# Some data sources are HTML with the plain text wrapped in pre tags
if "<pre>" in data:
data = data[data.find("<pre>")+5:data.find("</pre>")]
if cache_data:
try:
import codecs

2
zctas
View File

@@ -20,7 +20,7 @@
# ab78f945488371035514fc2c14e4679a 2020-05-24 airports.csv
#
# ...and these manually-generated or hand-compiled adjustments:
# aadcf8801156f29dc5c622bb5e874e88 2020-05-24 overrides.conf
# 298b10d8d6f5a4a41b2eb0c356766427 2020-05-24 overrides.conf
# ab8545489a62124779edf7214a619325 2020-05-24 slist
# 12c84e28cdb6da9eeba12b5a4af034b0 2020-05-24 zlist

9
zones
View File

@@ -20,7 +20,7 @@
# ab78f945488371035514fc2c14e4679a 2020-05-24 airports.csv
#
# ...and these manually-generated or hand-compiled adjustments:
# aadcf8801156f29dc5c622bb5e874e88 2020-05-24 overrides.conf
# 298b10d8d6f5a4a41b2eb0c356766427 2020-05-24 overrides.conf
# ab8545489a62124779edf7214a619325 2020-05-24 slist
# 12c84e28cdb6da9eeba12b5a4af034b0 2020-05-24 zlist
@@ -14710,6 +14710,13 @@ station = ('phsf', 0.0040525)
urgent_weather_message = https://tgftp.nws.noaa.gov/data/watches_warnings/non_precip/hi/hiz028.txt
zone_forecast = https://tgftp.nws.noaa.gov/data/forecasts/zone/hi/hiz028.txt
[hkz000]
centroid = (0.3897902, 1.9928751)
comment = suggested by Bill Agee
description = Hong Kong Observatory
station = ('vhhh', 0.0000000)
zone_forecast = https://www.hko.gov.hk/textonly/v2/forecast/nday.htm
[iaz001]
centroid = (0.7571326, -1.6791865)
coastal_flood_statement = https://tgftp.nws.noaa.gov/data/watches_warnings/flood/coastal/ia/iaz001.txt