Function Repository Resource:

WeatherRegionPlot

Source Notebook

Produce plots of weather properties over a geographic region

Contributed by: Jason Martinez

ResourceFunction["WeatherRegionPlot"][region,property,plottype]

returns the current values for property for the region using the format plottype.

ResourceFunction["WeatherRegionPlot"][region,property,date,plottype]

returns the values for property and date for the region using the format plottype.

Details and Options

The region should define a geographic region on the Earth. The region may be given as a combination of GeoGraphics primitives such as GeoDisk, GeoPolygon, and GeoPath, geographic Entity[] and EntityClass[] objects, or individual GeoPosition locations. For extended geographic entities, the "Polygon" property is used. For point-like entities, the "Position" property is used.
Results encompass the box containing the geographic region.
Weather properties available for vector and stream plots include:
"WindDirection"wind direction in degrees
"WindSpeed"wind speed
Weather properties available for density and contour plots include:
"CloudCoverFraction"fraction of the sky obscured by cloud cover
"Humidity"relative humidity
"PrecipitationAmount"precipitation amount
"PrecipitationRate"average precipitation rate
"Pressure"barometric pressure
"Temperature"temperature
"WindChill"wind chill temperature
"WindSpeed"wind speed
ResourceFunction["WeatherRegionPlot"]["WeatherProperties"] returns the properties for ResourceFunction["WeatherRegionPlot"].
The plottype formats include:
"Data"raw date in the form of {GeoPosition[{..}]->value..}
GeoContourPlotgeo contour plot
GeoDensityPlotgeo density plot
GeoStreamPlotgeo stream plot
GeoVectorPlotgeo vector plot
ResourceFunction["WeatherRegionPlot"]["OutputTypes"] returns the valid format types.
The date should be specified as a DateObject, date list, or as a string in DateString format.
ResourceFunction["WeatherRegionPlot"] takes date to be given by $TimeZone unless otherwise specified by a DateObject.
When date is omitted, results use the latest recorded values which can vary in age. Results are interpolated for the specific date when specified. Dates in the future use WeatherForecastData and are available up to a week in the future.
ResourceFunction["WeatherRegionPlot"] has the same options as specified plottype with the following additions and changes:
ContourLabelsAllinclude labels for contours
GeoRangePadding0how much to pad the geographic range
PlotLegendsAutomaticlegends for data
"ShowWeatherStations"Falseinclude geo markers for weather stations or forecast grid
UnitSystem$UnitSystemdetermines output units
ResourceFunction["WeatherRegionPlot"] draws on the same data as WeatherData and WeatherForecastData and is not available for all times and locations.

Examples

Basic Examples (1) 

Plot the current temperatures across Ohio:

In[1]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"Ohio", "UnitedStates"}], "Temperature", GeoDensityPlot]
Out[1]=

Scope (6) 

Find all available properties:

In[2]:=
ResourceFunction["WeatherRegionPlot"]["WeatherProperties"]
Out[2]=

Find all available output types:

In[3]:=
ResourceFunction["WeatherRegionPlot"]["OutputTypes"]
Out[3]=

Obtain the humidity values across Delaware at noon yesterday:

In[4]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"Delaware", "UnitedStates"}], "Humidity", DateObject[Yesterday, TimeObject[{12, 0, 0}]], "Data"]
Out[4]=

Generate a GeoContourPlot for temperature across Australia on a particular day:

In[5]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["Country", "Australia"], "Temperature", DateObject[{2020, 1, 15, 12, 0, 0}], GeoContourPlot]
Out[5]=

Examine the wind direction and magnitude across New Zealand in a GeoVectorPlot tomorrow:

In[6]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["Country", "NewZealand"], "WindDirection", Tomorrow, GeoVectorPlot]
Out[6]=

Examine wind vectors around California in a GeoStreamPlot:

In[7]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"California", "UnitedStates"}], "WindDirection", DateObject[{2020, 1, 1, 1, 0, 0}], GeoStreamPlot]
Out[7]=

Arguments (1) 

Regions can include lists of GeoPolygons, entities and other GeoGraphics objects:

In[8]:=
regions = {GeoPolygon[{{50, -100}, {50, -90}, {40, -90}, {50, -100}}],
    GeoPolygon[{{60, -110}, {60, -100}, {50, -100}, {60, -110}}]};
ResourceFunction[
 "WeatherRegionPlot"][regions, "Temperature", GeoDensityPlot]
Out[9]=

Options (3) 

Plot Options (1) 

WeatherRegionPlot supports all plot options for designated plot type:

In[10]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["Country", "Poland"], "Temperature", DateObject[Tomorrow, TimeObject[{15, 0, 0}]], GeoContourPlot, ContourShading -> True, ColorFunction -> "TemperatureMap"]
Out[10]=

ShowWeatherStations (1) 

Use ShowWeatherStations to add the contributing weather station locations:

In[11]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"California", "UnitedStates"}], "PrecipitationRate", DateObject[{2021, 10, 24, 17, 0, 0}, TimeZone -> Entity["TimeZone", "America/Los_Angeles"]], GeoDensityPlot, ShowWeatherStations -> True]
Out[11]=

UnitSystem (1) 

Use UnitSystem to control the units of returned properties:

In[12]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"SuffolkCounty", "NewYork", "UnitedStates"}], "WindChill", DateObject[{2001, 1, 27, 11, 28, 0}], "Data"]
Out[12]=
In[13]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"SuffolkCounty", "NewYork", "UnitedStates"}], "WindChill", DateObject[{2001, 1, 27, 11, 28, 0}], "Data", UnitSystem -> "Metric"]
Out[13]=

Possible Issues (2) 

"WindDirection" is incompatible with GeoDensityPlot and GeoContourPlot:

In[14]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"California", "UnitedStates"}], "WindDirection", Now, GeoDensityPlot]
Out[14]=

GeoStreamPlot and GeoVectorPlot are only compatible with "WindDirection" and "WindSpeed":

In[15]:=
ResourceFunction["WeatherRegionPlot"][
 Entity["AdministrativeDivision", {"California", "UnitedStates"}], "Temperature", GeoVectorPlot]
Out[15]=

Data is not available for all locations and times:

In[16]:=
ResourceFunction["WeatherRegionPlot"][
 Polygon[GeoPosition[{{45, -30}, {45, -20}, {40, -20}, {40, -30}}]], "WindChill", DateObject[{2020, 1, 1, 0, 0, 0}], "Data"]
Out[16]=

Version History

  • 1.0.1 – 28 October 2022
  • 1.0.0 – 30 November 2021

Related Resources

License Information