Retrieves the India Meteorological Department (IMD) city-weather station list
and, optionally, each station's latitude/longitude. IMD's legacy endpoints
expose only station names; its responsive site serves a per-station JSON record
(api/fetchCity_static.php) that includes lat/lon, which this function
pairs with the station list. The returned coordinates can be fed directly to
era5ify_point() or used to build maps.
Arguments
- ...
Ignored (present for alias compatibility).
- with_coordinates
Logical; if
TRUE(default) fetchlatitudeandlongitudefor every station (one request per station). IfFALSE, return onlystation_idandname.- cores
Integer; number of parallel workers used to fetch coordinates (passed to
parallel::mclapply()). Defaults to 4; set to 1 on Windows.
Value
A data.frame with columns station_id, name, and — when
with_coordinates = TRUE — latitude, longitude (NA where IMD has no
coordinate for a station).
Examples
if (FALSE) { # \dontrun{
stations <- imd_stations()
shimla <- stations[grepl("Shimla", stations$name), ]
} # }
