parse_precis_forecast function

Parse BOM Précis Forecast XML Files

Parse BOM Précis Forecast XML Files

Parse local BOM daily précis forecast XML file(s) of the seven-day town forecasts for a specified state or territory or all Australia. Ported from bomrang.

parse_precis_forecast(state, filepath)

Arguments

  • state: Required value of an Australian state or territory as full name or postal code. Fuzzy string matching via base::agrep() is done.
  • filepath: A string providing the directory location of the précis file(s) to parse. See Details for more.

Returns

A data.table::data.table() of Australia BOM précis seven-day forecasts for BOM selected towns.

Details

Allowed state and territory postal codes, only one state per request or all using 'AUS'.

  • ACT: Australian Capital Territory (will return NSW)
  • NSW: New South Wales
  • NT: Northern Territory
  • QLD: Queensland
  • SA: South Australia
  • TAS: Tasmania
  • VIC: Victoria
  • WA: Western Australia
  • AUS: Australia, returns forecast for all states, NT and ACT

The filepath argument will only accept a directory where files are located for parsing. DO NOT supply the full path including the file name. This function will only parse the requested state or all of Australia in the same fashion as get_precis_forecast(), provided that the files are all present in the directory.

Examples

# parse the short forecast for Western Australia # download to tempfile() using basename() to keep original name utils::download.file(url = "ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ11295.xml", destfile = file.path(tempdir(), basename("ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ11295.xml")), mode = "wb") parse_precis_forecast(state = "QLD", filepath = tempdir())

References

Forecast data come from Australian Bureau of Meteorology (BOM ) Weather Data Services

http://www.bom.gov.au/catalogue/data-feeds.shtml

Location data and other metadata for towns come from the BOM anonymous FTP server with spatial data

ftp://ftp.bom.gov.au/anon/home/adfd/spatial/, specifically the DBF file portion of a shapefile,

ftp://ftp.bom.gov.au/anon/home/adfd/spatial/IDM00013.dbf

See Also

get_precis_forecast

Other BOM: find_forecast_towns(), get_ag_bulletin(), get_available_imagery(), get_available_radar(), get_coastal_forecast(), get_precis_forecast(), get_radar_imagery(), get_satellite_imagery(), parse_ag_bulletin(), parse_coastal_forecast()

Other parse: parse_ag_bulletin(), parse_coastal_forecast()

Author(s)

Adam H. Sparks, [email protected] , and Keith Pembleton, [email protected] , and Paul Melloy, [email protected]

Other functions in weatherOz

Related functions from the same R package