Geographic Visualization

Emmanuel Garcés Medina, Wolfram Research

Join the Conversation #WolframTechConf

Talk Overview

Very brief introduction of GeoGraphics features

Introduce GeoSmoothHistogram (New in 11.3)

How same geographic data can be visualized with existing geo visualization functions

Geo entities

Geo entities with associated values

Particular features of geo visualization functions

GeoVectorPlot and GeoStreamPlot (New in 12.0)

Very brief introduction of GeoGraphics features

Options

Primitives

GeoSmoothHistogram (New in 11.3)

Overview

We used to plot histograms of geographic data with GeoHistogram:

GeoHistogram[CityData[{All,"Iceland"}],PlotLegends->Automatic]

GeoHistogram[WeightedData[CountryData["UnitedStates","LargestCities"],#["Population"]&],PlotLegends->Automatic]

Now we can use GeoSmoothHistogram to show a plot of the PDF based on a smooth kernel estimate from the same data:

GeoSmoothHistogram[CityData[{All,"Iceland"}],PlotLegends->Automatic]

GeoSmoothHistogram[WeightedData[CountryData["UnitedStates","LargestCities"],#["Population"]&],PlotLegends->Automatic]

Plot Methods

We can adjust the bandwidth method of the plot

data=GeoPosition[];

Table[GeoSmoothHistogram[data,name,PlotLabel->name],{name,{"LeastSquaresCrossValidation","StandardDeviation"}}]

And the kernel method also can be set:

data=GeoPosition[];

Table[GeoSmoothHistogram[data,{Automatic,i},PlotLabel->i,FrameTicks->None],{i,{"Biweight","Gaussian"}}]

Options

Options from Geographics and SmoothDensityHistogram can be set into GeoSmoothHistogram

Application Example

trees = GeoPosition[];

¨{GeoSmoothHistogram[trees,ColorFunction->(RGBColor[0,0.8#,0,0.8#]&)],GeoGraphics[LinguisticAssistant,GeoBackground->"Satellite",GeoServer->"DigitalGlobe"]}

Geographic Data and Visualization Functions

GeoEntities

EntityClass

data=LinguisticAssistant;

{GeoListPlot[data,PlotLabel->"GeoListPlot"],GeoHistogram[data,PlotLabel->"GeoHistogram"],GeoSmoothHistogram[data,PlotLabel->"GeoSmoothHistogram"]}

Array of Coordinates

data=RandomGeoPosition[300]

{GeoListPlot[data,PlotLabel->"GeoListPlot"],GeoHistogram[data,PlotLabel->"GeoHistogram"],GeoSmoothHistogram[data,PlotLabel->"GeoSmoothHistogram"]}

GeoEntities with Associated Values

Entities can be anyone of the structures mentioned earlier and values can be numeric or quantities. Both of them can be associated by using Association, WeightedData, Rules, or pair of Lists.

GeoEntities associated to Numbers

geoentities=EntityList[LinguisticAssistant];

values=QuantityMagnitude[EntityValue[geoentities,"Population"]];

Short[data=Thread[geoentities->values],1]

{GeoRegionValuePlot[data,PlotLabel->"GeoRegionValuePlot"],GeoBubbleChart[data,PlotLabel->"GeoBubbleChart"],GeoHistogram[data,PlotLabel->"GeoHistogram"],GeoSmoothHistogram[data,PlotLabel->"GeoSmoothHistogram"]}

GeoEntities associated to Quantities

counties = Join@@EntityValue[{(Entity["Texas, United States", Entity["AdministrativeDivision",{"Texas","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Texas\", \"UnitedStates\"}]", "administrative division"]),(Entity["New Mexico, United States", Entity["AdministrativeDivision",{"NewMexico","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"NewMexico\", \"UnitedStates\"}]", "administrative division"]),(Entity["Arizona, United States", Entity["AdministrativeDivision",{"Arizona","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Arizona\", \"UnitedStates\"}]", "administrative division"]),
(Entity["Nevada, United States", Entity["AdministrativeDivision",{"Nevada","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Nevada\", \"UnitedStates\"}]", "administrative division"]),(Entity["California, United States", Entity["AdministrativeDivision",{"California","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"California\", \"UnitedStates\"}]", "administrative division"])},(EntityProperty["subdivisions", EntityProperty["AdministrativeDivision","Subdivisions"], "EntityProperty[\"AdministrativeDivision\", \"Subdivisions\"]"])];

vals = EntityValue[counties,"PerCapitaIncome"];

Short[data=Thread[counties->vals],.2]

{GeoRegionValuePlot[data,PlotLabel->"GeoRegionValuePlot"],GeoBubbleChart[data,PlotLabel->"GeoBubbleChart"],GeoHistogram[data,PlotLabel->"GeoHistogram"],GeoSmoothHistogram[data,PlotLabel->"GeoSmoothHistogram"]}

Association map

data=AssociationMap[(EntityProperty["population", EntityProperty["Country","Population"], "EntityProperty[\"Country\", \"Population\"]"]),EntityList[LinguisticAssistant]];

{GeoRegionValuePlot[data,PlotLabel->"GeoRegionValuePlot"],GeoBubbleChart[data,PlotLabel->"GeoBubbleChart"],GeoHistogram[data,PlotLabel->"GeoHistogram"],GeoSmoothHistogram[data,PlotLabel->"GeoSmoothHistogram"]}

Particular features in Geo Visualization functions

GeoListPlot supports sets of groups of entities

GeoListPlot[{{LinguisticAssistant,LinguisticAssistant},{LinguisticAssistant,LinguisticAssistant},{LinguisticAssistant,LinguisticAssistant}}]

GeoHistogram supports different bin specifications

data=RandomGeoPosition[LinguisticAssistant,100];

Table[GeoHistogram[data, bin],{bin,{"Rectangle","Triangle",Quantity[1000,"Acres"],"SchoolDistrict"}}]

GeoBubbleChart has the ability to show bubble shapes as function of data

states = CountryData["UnitedStates","AdministrativeDivisions"];

data = Table[Tooltip[AdministrativeDivisionData[state,"Position"]->UnitConvert[AdministrativeDivisionData[state,"Area"],"Acres"], Magnify[StringSplit[AdministrativeDivisionData[state,"Name"],","][[1]]]],{state,states}];

chartelements = Table[PieChart[{AdministrativeDivisionData[state,"Area"]-AdministrativeDivisionData[state,"FarmLandArea"],AdministrativeDivisionData[state,"FarmLandArea"]}],{state,states}];

GeoBubbleChart[data, ChartElements->chartelements]

GeoVectorPlot and GeoStreamPlot (New in 12.0)

In version 12.0 we can plot vector fields and streamlines from vector fields with new functions GeoVectorPlot and GeoStreamPlot

Basic example

Use GeoVector to represent a collection of vectors with modulus m and bearing α

{GeoVectorPlot[GeoVector[]],GeoStreamPlot[GeoVector[]]}

More input specifications

Use GeoVectorENU to represent a collection vectors of components east and north in an orthonormal frame tangent to the Earth at corresponding locations

coords=RandomGeoPosition[50];

vects = Table[RandomReal[{1,-1},2],{50}];

{GeoVectorPlot[GeoVectorENU[coords->vects]],GeoStreamPlot[GeoVectorENU[coords->vects]]}

Use QuantityArray to represent an array of quantity vectors :

coords=RandomGeoPosition[50];

vectors=QuantityArray[Table[RandomReal[{-1,1},2],50],"Kilometers"];

{GeoVectorPlot[{coords,vectors}],GeoStreamPlot[{coords,vectors}]}

Options

Options from ListVectorPlot and Geographics can be set for GeoVectorPlot

VectorMarkers option is new in 11.3

Also, options for ListStreamPlot and Geographics can be set for GeoStreamPlot

Some Applications

Plot the wind directions of the Hurricane Florence at the land area of the United States on september, 2018

data=;

GeoVectorPlot[data,VectorScale->0.15,VectorPoints->{25,25},VectorStyle->{Opacity[0.5],Lighter[Blue]},GeoBackground->"StreetMap", RegionFunction->LinguisticAssistant]

Generate streamlines from the magnetic direction field on the North Pole:

coords=GeoPosition[Flatten[Table[{lat,lon},{lat,75,90,5},{lon,-180,180,10}],1]];

gm=GeomagneticModelData[coords];

norms=QuantityMagnitude[gm[[All,"Magnitude"]]];

declinations=gm[[All,"Declination"]];

vectors=Transpose[{norms,declinations}];

GeoStreamPlot[GeoVector[coords->vectors],GeoBackground->"ReliefMap",StreamStyle->White]