Skip to contents

Parse local BOM agriculture bulletin XML file(s) and return a data frame for a specified state or territory or all Australia.

Usage

parse_ag_bulletin(state, filepath)

Arguments

state

Required value of an Australian state or territory as full name or postal code. Fuzzy string matching via agrep is done.

filepath

A string providing the directory location of the précis file(s) to parse. See Details for more.

Value

A data.table of Australia BOMagricultural bulletin information. For full details of fields and units returned see Appendix 3 in the bomrang vignette, use
vignette("bomrang", package = "bomrang") to view.

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.

References

Agricultural observations are retrieved from the Australian Bureau of Meteorology (BOM) Weather Data Services Agriculture Bulletins,
http://www.bom.gov.au/catalogue/observations/about-agricultural.shtml

and

Australian Bureau of Meteorology (BOM)) Weather Data Services Observation of Rainfall,
http://www.bom.gov.au/climate/how/observations/rain-measure.shtml

Station location and other metadata are sourced from the Australian Bureau of Meteorology (BOM) webpage, Bureau of Meteorology Site Numbers:
http://www.bom.gov.au/climate/cdo/about/site-num.shtml

See also

Author

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

Examples

# \donttest{
# parse the ag bulletin for Queensland

# download to tempfile() using basename() to keep original name
download.file(url = "ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ60604.xml",
              destfile = file.path(tempdir(),
              basename("ftp://ftp.bom.gov.au/anon/gen/fwo/IDQ60604.xml")),
              mode = "wb")

BOM_bulletin <- parse_ag_bulletin(state = "QLD",
                                  filepath = tempdir())

BOM_bulletin
#>     product_id state dist                             name   wmo  site
#>  1:   IDQ60604   QLD   27                       WEIPA AERO 94170 27045
#>  2:   IDQ60604   QLD   29                   MOUNT ISA AERO 94332 29127
#>  3:   IDQ60604   QLD   30               GEORGETOWN AIRPORT 94274 30124
#>  4:   IDQ60604   QLD   31                      CAIRNS AERO 94287 31011
#>  5:   IDQ60604   QLD   31        WALKAMIN RESEARCH STATION 95284 31108
#>  6:   IDQ60604   QLD   31                  MAREEBA AIRPORT 95286 31210
#>  7:   IDQ60604   QLD   32          SOUTH JOHNSTONE EXP STN 95292 32037
#>  8:   IDQ60604   QLD   32                  TOWNSVILLE AERO 94294 32040
#>  9:   IDQ60604   QLD   33             AYR DPI RESEARCH STN 95295 33002
#> 10:   IDQ60604   QLD   33         COLLINSVILLE POST OFFICE 94360 33013
#> 11:   IDQ60604   QLD   33                       MACKAY M.O 94367 33119
#> 12:   IDQ60604   QLD   35                TAMBO POST OFFICE 94355 35069
#> 13:   IDQ60604   QLD   35                  EMERALD AIRPORT 94363 35264
#> 14:   IDQ60604   QLD   36                   LONGREACH AERO 94346 36031
#> 15:   IDQ60604   QLD   38                   BOULIA AIRPORT 94333 38003
#> 16:   IDQ60604   QLD   38               BIRDSVILLE AIRPORT 95482 38026
#> 17:   IDQ60604   QLD   39                 ROCKHAMPTON AERO 94374 39083
#> 18:   IDQ60604   QLD   39                 THANGOOL AIRPORT 94376 39089
#> 19:   IDQ60604   QLD   39                   BUNDABERG AERO 94387 39128
#> 20:   IDQ60604   QLD   40  UNIVERSITY OF QUEENSLAND GATTON 94562 40082
#> 21:   IDQ60604   QLD   40                    BRISBANE AERO 94578 40842
#> 22:   IDQ60604   QLD   40 LOGAN CITY WATER TREATMENT PLANT 95581 40854
#> 23:   IDQ60604   QLD   41                       OAKEY AERO 94552 41359
#> 24:   IDQ60604   QLD   41                    DALBY AIRPORT 94542 41522
#> 25:   IDQ60604   QLD   41                          WARWICK 94555 41525
#> 26:   IDQ60604   QLD   43             MITCHELL POST OFFICE 94514 43020
#> 27:   IDQ60604   QLD   43                     ROMA AIRPORT 94515 43091
#> 28:   IDQ60604   QLD   43                ST GEORGE AIRPORT 94517 43109
#> 29:   IDQ60604   QLD   44                 CHARLEVILLE AERO 94510 44021
#> 30:   IDQ60604   QLD   45             THARGOMINDAH AIRPORT 95492 45025
#>     product_id state dist                             name   wmo  site
#>                  station      obs_time_local        obs_time_utc time_zone
#>  1:                Weipa 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  2:            Mount Isa 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  3:   Georgetown Airport 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  4:               Cairns 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  5:             Walkamin 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  6:              Mareeba 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  7:      South Johnstone 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  8:           Townsville 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>  9:                  Ayr 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 10:         Collinsville 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 11:               Mackay 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 12:                Tambo 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 13:              Emerald 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 14:            Longreach 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 15:               Boulia 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 16:           Birdsville 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 17:          Rockhampton 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 18:             Thangool 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 19:            Bundaberg 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 20:               Gatton 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 21:     Brisbane Airport 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 22:           Logan City 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 23:                Oakey 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 24:                Dalby 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 25:              Warwick 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 26:             Mitchell 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 27:                 Roma 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 28:            St George 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 29:          Charleville 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#> 30: Thargomindah Airport 2022-06-02 09:00:00 2022-06-01 23:00:00       EST
#>                  station      obs_time_local        obs_time_utc time_zone
#>          lat      lon  elev bar_ht start  end   r   tn   tx twd  ev   tg  sn
#>  1: -12.6778 141.9208  18.0   18.6  1972 2021 0.0 19.7 31.7 2.9  NA   NA  NA
#>  2: -20.6778 139.4875 340.3  341.0  1966 2021 0.0 16.6 22.6 5.5  NA   NA  NA
#>  3: -18.3039 143.5306 301.8  302.5  2004 2021 0.0 15.0 31.9 8.0  NA   NA  NA
#>  4: -16.8736 145.7458   2.2    2.6  1941 2021 0.0 19.6 28.5 4.8  NA   NA  NA
#>  5: -17.1347 145.4281 594.0     NA  1965 2021 0.0 16.2 26.8 3.0 2.8 15.0  NA
#>  6: -17.0704 145.4293 471.9  473.1  2000 2021 0.0 14.6 27.2 2.4  NA   NA  NA
#>  7: -17.6053 145.9972  18.3   18.6  1920 2021 0.0 17.6 28.4 1.9  NA   NA  NA
#>  8: -19.2483 146.7661   4.3    4.6  1940 2021 0.0 13.1 27.8 4.7  NA   NA  NA
#>  9: -19.6169 147.3758  17.0     NA  1951 2021 0.0 11.3 26.9  NA  NA   NA  NA
#> 10: -20.5533 147.8464 196.0     NA  1939 2021 0.0 10.4 26.6 2.3 2.6   NA  NA
#> 11: -21.1172 149.2169  30.3   30.3  1959 2021 0.0 13.7 23.9 4.2  NA   NA  NA
#> 12: -24.8819 146.2564 395.1  397.4  1877 2021 0.0  8.9 16.6 2.5 2.4  7.0  NA
#> 13: -23.5694 148.1756 189.4  190.1  1981 2021 0.0 12.9 23.3 4.1  NA   NA  NA
#> 14: -23.4397 144.2828 192.2  192.5  1949 2021 0.2  9.7 17.0 1.5  NA   NA  NA
#> 15: -22.9117 139.9039 161.8  158.3  1886 2021 2.0 12.4 14.4 0.3 2.0 11.5  NA
#> 16: -25.8975 139.3472  46.6   47.0  2000 2021 1.6 11.7 15.2 0.1  NA   NA  NA
#> 17: -23.3753 150.4775  10.4   15.1  1939 2021 0.0 14.7 25.0 4.9  NA   NA  NA
#> 18: -24.4935 150.5709 193.1  193.8  1929 2021 0.0 12.0 22.0 5.4  NA   NA  NA
#> 19: -24.9069 152.3230  30.8   31.5  1942 2021 0.0 13.4 22.4 5.6  NA   NA  NA
#> 20: -27.5436 152.3375  89.0     NA  1897 2021 0.0  9.5 19.1  NA  NA   NA  NA
#> 21: -27.3917 153.1292   4.5    9.5  1992 2021 0.0  7.9 20.2 5.4  NA  2.0 9.1
#> 22: -27.6839 153.1947  14.0     NA  1992 2021 0.0 13.5 20.7 4.8  NA   NA  NA
#> 23: -27.4034 151.7413 405.7  407.1  1970 2021 0.0  4.1 16.4 2.7  NA   NA  NA
#> 24: -27.1605 151.2634 343.9  344.4  1992 2021 0.0  6.2 17.4 3.5  NA   NA  NA
#> 25: -28.2061 152.1003 475.4  475.8  1994 2021 0.0  0.9 15.3 4.0  NA   NA  NA
#> 26: -26.4888 147.9777 336.5  338.0  1884 2021 0.0  6.6 18.1 3.6  NA  6.0  NA
#> 27: -26.5477 148.7710 307.4  307.8  1985 2021 0.0  6.1 19.0  NA  NA   NA  NA
#> 28: -28.0478 148.5957 198.5  199.1  1997 2021 0.0  6.5 16.4 3.5  NA   NA  NA
#> 29: -26.4139 146.2558 301.6  303.3  1942 2021 0.0 10.0 17.0 4.8  NA   NA  NA
#> 30: -27.9867 143.8150 130.9  131.4  1999 2021 0.0 11.3 15.8 4.8  NA   NA  NA
#>          lat      lon  elev bar_ht start  end   r   tn   tx twd  ev   tg  sn
#>     solr   t5  t10  t20  t50  t1m  wr
#>  1: 20.6   NA   NA   NA   NA   NA  NA
#>  2: 12.4   NA   NA   NA   NA   NA  NA
#>  3: 18.2   NA   NA   NA   NA   NA  NA
#>  4: 17.9   NA   NA   NA   NA   NA  NA
#>  5: 18.4   NA 21.3 23.0   NA   NA  80
#>  6: 18.8 22.2   NA 23.4   NA 25.6  68
#>  7: 17.8   NA   NA   NA   NA   NA  NA
#>  8: 17.9   NA   NA   NA   NA   NA  NA
#>  9: 17.7   NA   NA   NA   NA   NA  NA
#> 10: 17.4   NA   NA   NA   NA   NA  NA
#> 11: 17.0   NA   NA   NA   NA   NA  NA
#> 12: 10.6   NA   NA   NA   NA   NA  NA
#> 13: 14.7 18.6 18.3 19.9 21.2   NA  NA
#> 14:  7.9   NA 18.5 19.6 22.1 24.7  NA
#> 15:  8.4   NA   NA   NA   NA   NA  NA
#> 16:  6.6   NA   NA   NA   NA   NA  NA
#> 17: 16.0   NA   NA   NA   NA   NA  NA
#> 18: 15.0   NA   NA   NA   NA   NA  NA
#> 19: 15.4 16.8 17.5 18.7 18.0 70.0  NA
#> 20: 14.3   NA   NA   NA   NA   NA  NA
#> 21: 14.4 15.0 16.0 17.0 19.0 21.0 348
#> 22: 14.2   NA   NA   NA   NA   NA  NA
#> 23: 14.4   NA   NA   NA   NA   NA  NA
#> 24: 14.4 12.2   NA 14.3   NA   NA 248
#> 25: 14.0  8.6  9.3 11.8 12.8 16.1 153
#> 26: 13.6   NA   NA   NA   NA   NA  NA
#> 27: 14.1 15.3 14.8 16.7 17.9   NA  NA
#> 28: 13.6 12.6 12.8 14.1 17.4 20.0  NA
#> 29: 13.1   NA   NA   NA   NA   NA  NA
#> 30: 12.1   NA   NA   NA   NA   NA  NA
#>     solr   t5  t10  t20  t50  t1m  wr
# }