Description Usage Arguments Details Value Author(s) See Also Examples
The DWD MOSMOX forecasts are provided as XML files. The "header" of the XML file contains some information about the MOSMIX model, initialization time, and so far and so on. This method extracts the meta information.
1 2 3 4 | get_meta_info(doc)
## S3 method for class 'dwdmeta'
print(x, ...)
|
doc |
an |
x |
an object of class |
... |
forwarded to S3 methods. Unused for now. |
Extracts the following information from the XML file:
Issuer
who created these forecasts.
ProductID
GeneratingProcess
IssueTime
the initialization time (most important
information). Will also be used when creating the output files
(see write_ascii
).
ReferencedModel
the NWP models the MOS is based on.
Returns an object of class dwdmeta
.
Reto Stauffer
Reto Stauffer
get_station_information, get_meta_info, get_datetime.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Latest L-type DWD MOSMIX forecast file for Innsbruck Airport
url <- "https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/11120/kml/MOSMIX_L_LATEST_11120.kmz"
# Download and extract file
kmz <- tempfile("mosmix_demo_", fileext = ".kmz")
check <- download.file(url, kmz)
if ( inherits(check, "try-error") ) stop("Problems downloading the file!")
kml <- unzip(kmz)
# Parsing the unzipped kml file (XML format)
doc <- XML::xmlParse(kml)
# Extracting meta information
meta <- get_meta_info(doc)
print(meta)
# Remove kmz and kml file
file.remove(kmz, kml)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.