Geographic Visualization

Nirmal Malapaka, Wolfram Research

Join the Conversation #WolframTechConf

Overview

Abstract

Wolfram Language has a wide variety of technologies built in to visualize geographical data. In this talk we will look at the different ways to acquire geo data, explore and work with the data and visualize the data using GeoGraphics.

Basic Geo Visualization

GeoGraphics

Primitives

Styling

GeoListPlot

GeoRegionValuePlot

Using GeoGraphics to Explore Data

Worlds and Maps

Visualizing Places

Visualize current location:

Visualize the world:

Worlds and Maps

Information is obtained from the Entity framework.

GeoGraphics will visualize the data.

Visualizing Places

Visualize a city:

Here we see more than just the city.

Worlds and Maps

Interacting with Visualizations

GeoGraphics[GeoMarker[LinguisticAssistant],GeoRange->{{50, 60},{-10,5}},Frame->True]

Worlds and Maps

Interacting with Visualizations

Partition[GeoGraphics[GeoRange->"World",GeoProjection->#,GeoGridLines->Automatic,PlotLabel->#]&/@{"Albers","Armadillo","Bonne","Mercator","WinkelTripel","Mollweide","Orthographic","Wiechel","LambertAzimuthal"},3]//Grid

Use a scale in kilometers for equatorial distance. The same radius geo disks show distance distortion:

GeoGraphics[Table[GeoDisk[{lat,lon},Quantity[1000,"Kilometers"]],{lat,-60,60,20},{lon,-140,140,40}],GeoRange->"World",GeoProjection->{"Mercator","ReferenceModel"->6378.137},
Frame->True]

Worlds and Maps

Interacting with Visualizations

GeoGraphics[GeoMarker[LinguisticAssistant],GeoRange->{{50, 60},{-10,5}},Frame->True,GeoProjection->"Equirectangular"]

GeoGraphics[GeoMarker[LinguisticAssistant],Frame->True,GeoRange->{{50, 60},{-10,5}},GeoProjection->"Equirectangular",PlotRange->{{-12,7},{45,65}}]

GeoGraphics

Structure of GeoGraphics

GeoGraphics has head GeoGraphics, but its first argument is Graphics object. GeoGraphics contains options with absolute values — input options and computed Options.

Head[GeoGraphics[]]

Head[GeoGraphics[][[1]]]

Options[GeoGraphics[LinguisticAssistant],GeoProjection]

The geo primitives are converted into standard primitives in the "Equirectangular" projection, so that they can be easily displayed using Graphics.

The standard, non-geo graphical primitives, like Line, Polygon, Circle, etc. can also be used in GeoGraphics, but are interpreted as primitives on the flat map, not on the surface of the Earth as their geo counterparts are.

Primitives

The use of GeoPosition inside Point guarantees that the points will be properly placed in the map for any projection.

GeoGraphics[{PointSize[Large], Red,Point[LinguisticAssistant]},GeoRange->"World",GeoProjection->"Albers"]

Options[%,GeoModel]

GeoGraphics[GeoMarker[LinguisticAssistant,EntityValue[LinguisticAssistant,"Flag"]],GeoRange->"World",GeoProjection->"Albers"]

Primitives

Geodesic path between two points:

GeoGraphics[{{Blue,Thick,Line[{GeoPosition[{90,0}],GeoPosition[{-90,0}]}]},
{Red,Thick,GeoPath[{GeoPosition[{90,0}],GeoPosition[{-90,0}]}]}},GeoRange->"World",GeoProjection->{"LambertAzimuthal","Centering"->{-20,20}}]

Geodesic around Chicago:

GeoGraphics[{Red,Thick,GeoCircle[LinguisticAssistant,Quantity[5000,"Kilometers"]],
Blue,Thick,Circle[LinguisticAssistant,50]
}]

Primitives

({{GeoHemisphere[loc], hemisphere centered at loc}, {DayHemisphere[date], daylight hemisphere at the given date}, {NightHemisphere[date], night hemisphere at the given date}, {GeoHemisphereBoundary[loc], boundary of the hemisphere centered at log}, {DayNightTerminator[date], terminator line between the day and night hemisphere on date}})

GeoGraphics[GeoHemisphere[LinguisticAssistant],GeoRange->"World"]

({{GeoVisibleRegion[loc], visible region from the elevated position loc}, {GeoVisibleRegionBoundary[loc], boundary of the visible region from the elevated position loc}})

SatelliteData[(Entity["International Space Station", Entity["Satellite","25544"], "Entity[\"Satellite\", \"25544\"]", "satellite"]),"Position"]

GeoGraphics[GeoVisibleRegion[%],GeoRange->"World"]

Primitives

armstrong=EntityValue[(Entity["Neil Armstrong", Entity["Person","NeilArmstrong::368kz"], "Entity[\"Person\", \"NeilArmstrong::368kz\"]", "person"]),"Image"];
GeoGraphics[{LinguisticAssistant,{Lighter[Red],Thick,Line[{{2,1},LinguisticAssistant}]},
Inset[Pane[armstrong,ImageSize->Small],Scaled@{.7,.7}],
Inset[Framed["\"Houston, Tranquility Base here. The Eagle has landed.\"",ImageSize->Medium,RoundingRadius->3,Background->Lighter[Gray, 0.5]],Scaled@{.7,.45}]},GeoProjection->{"Orthographic","Centering"->{10,20}},GeoRange->"World",GeoGridLines->Automatic,Frame->True,PlotRange->{{-1,3},{-1,1.5}},ImageSize->Large]

Styling

Types of maps:

Row[GeoGraphics[{EdgeForm[Black],GeoStyling[#],Polygon[LinguisticAssistant]},ImageSize->"Medium",PlotLabel->#]&/@{"ReliefMap","StreetMap", "ContourMap", {"Image",LinguisticAssistant}}]

GeoGraphics[{EdgeForm[Black],GeoStyling["StreetMap"],Polygon[LinguisticAssistant]},ImageSize->"Medium",GeoBackground->"ReliefMap"]

Styling

Map server:

Row[GeoGraphics[LinguisticAssistant,GeoServer->#,ImageSize->"Medium"]&/@{Automatic,"http://a.tile.openstreetmap.org/`1`/`2`/`3`.png"}]

Applications

GeoListPlot

GeoListPlot[{{LinguisticAssistant,LinguisticAssistant},{LinguisticAssistant,LinguisticAssistant}},Joined->True,PlotStyle->{Directive[Blue,Dashed,EdgeForm[{Red,Thick}],Opacity[1]],Directive[Red, Opacity[.5],EdgeForm[{Thick,Black,Dashed}]]},GeoBackground->"ReliefMap"]

ts=EventSeries[{{{1492,8,3},(Entity["Palos de la Frontera", Entity["City",{"PalosDeLaFrontera","Huelva","Spain"}], "Entity[\"City\", {\"PalosDeLaFrontera\", \"Huelva\", \"Spain\"}]", "city"])},{{1492,9,6},(Entity["La Gomera", Entity["Island","LaGomera"], "Entity[\"Island\", \"LaGomera\"]", "island"])},{{1492,10,12},(Entity["San Salvador, Bahamas", Entity["AdministrativeDivision",{"SanSalvador","Bahamas"}], "Entity[\"AdministrativeDivision\", {\"SanSalvador\", \"Bahamas\"}]", "administrative division"])},{{1492,10,28},(Entity["Cuba", Entity["Country","Cuba"], "Entity[\"Country\", \"Cuba\"]", "country"])},{{1492,12,5},(Entity["Hispaniola", Entity["Island","Hispaniola"], "Entity[\"Island\", \"Hispaniola\"]", "island"])},{{1493,2,15},(Entity["Azores, Portugal", Entity["AdministrativeDivision",{"Azores","Portugal"}], "Entity[\"AdministrativeDivision\", {\"Azores\", \"Portugal\"}]", "administrative division"])},{{1493,3,8},(Entity["Lisbon", Entity["City",{"Lisbon","Lisboa","Portugal"}], "Entity[\"City\", {\"Lisbon\", \"Lisboa\", \"Portugal\"}]", "city"])}}];

GeoListPlot[ts, Joined->True,GeoRange->"World",ImageSize->Large,PlotLabel->"Columbus' Voyage 1492"]

Applications

GeoRegionValuePlot

GeoRegionValuePlot[{LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant,LinguisticAssistant->LinguisticAssistant},ImageSize->Large,GeoBackground->"StreetMap",PlotLabel->"World's Largest Petrolium Reserves"]

Applications

GeoRegionValuePlot

GeoRegionValuePlot[{LinguisticAssistant->7,LinguisticAssistant->6,LinguisticAssistant->5,LinguisticAssistant->4,LinguisticAssistant->3,LinguisticAssistant->3,LinguisticAssistant->3,LinguisticAssistant->3,LinguisticAssistant->1,
LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1,LinguisticAssistant->1},ImageSize->Large,PlotLabel->"# Presidents by State"]

MER-A

spirit=Import["/home/nirmal/Downloads/Mathematica/Spirit.txt","CSV"];

spirit

spiritcoords=Drop[spirit,None,3];

spiritlatlong =Rest[ Most/@spiritcoords];

spiritposition=Rest[spiritcoords];

spiritlandingsite=LinguisticAssistant;

GeoGraphics[{Red,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]},Frame->True]

GeoGraphics[{Red,GeoPath[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]},Frame->True]

GeoGraphics[{Red,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]},Frame->True,GeoRange->Quantity[10,"Miles"]]

GeoGraphics[{Red,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]},GeoRange->"World",GeoProjection->"Albers",ImageSize->Large]

MER-B

op=Import["/home/nirmal/Downloads/Mathematica/Opportunity.txt","CSV"];

opcoords=Drop[op,None,3];

opcoords = Append[#,0]&/@opcoords;

oplatlong =Rest[ Most/@opcoords];

opposition=Rest[opcoords];

oplandingsite=LinguisticAssistant;

GeoGraphics[{Yellow,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]},Frame->True]

GeoGraphics[{Yellow,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]},Frame->True,GeoRange->Quantity[100,"Miles"]]

GeoGraphics[{Yellow,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]},GeoRange->"World",GeoProjection->"Albers",ImageSize->Large]

Legended[GeoGraphics[{
GeoMarker[First[oplandingsite],"Color"->Yellow],GeoMarker[LinguisticAssistant,"Color"->Blue],
GeoDisk[First[oplandingsite],Quantity[1500,"NauticalMiles"]],Purple,Thickness[0.005],GeoCircle[First[oplandingsite],Quantity[1500,"NauticalMiles"]]},GeoCenter->LinguisticAssistant,
GeoRange->Quantity[2000,"Miles"],
Frame->True,GeoScaleBar->{"Imperial", "Metric"},ImageSize->Large],SwatchLegend[{Yellow, Blue},{"MER-B","Face on Mars"}]]

More Explorations

Legended[GeoGraphics[
{
{Yellow,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]}
,
{Red,Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]}
,
{Arrow@Line[{{100,50},First[spiritlandingsite]}],Text["MER-A",{100,55},Background->White],Arrow@Line[{{2,-50},First[oplandingsite]}],Text["MER-B",{2.5,-55},Background->White]}
},GeoRange->"World",GeoProjection->"Equirectangular",
GeoGridLines->Automatic,GeoGridLinesStyle->Directive[Thin,Orange,Opacity[0.5]],Frame->True,ImageSize->Large],SwatchLegend[{Red,Yellow},{"Spirit","Opportunity"}]]

Legended[GeoGraphics[
{
{Yellow,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]}
,
{Red,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]}
,
{Blue,Thick, GeoPath[{First[spiritlandingsite],First[oplandingsite]}]}
,
{Purple,GeoPath[{"Parallel",40}],Cyan,GeoPath[{"Parallel",0}],Magenta,GeoPath[{"Parallel",-40}]}
},GeoRange->"World",GeoProjection->"LambertAzimuthal"],SwatchLegend[{Red,Yellow,Blue},{"Spirit","Opportunity","Geodesic path"}]]

Legended[GeoGraphics[
{
{Yellow,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]}
,
{Red,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]}
,
{Blue,Thick, GeoPath[{First[spiritlandingsite],First[oplandingsite]}]}
,
{Purple,GeoPath[{"Parallel",40}],Cyan,GeoPath[{"Parallel",0}],Magenta,GeoPath[{"Parallel",-40}]}
},GeoRange->"World",GeoProjection->{"LambertAzimuthal", "Centering"->{-50,-30}}],SwatchLegend[{Red,Yellow,Blue},{"Spirit","Opportunity","Geodesic path"}]]

Legended[GeoGraphics[
{
{Yellow,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]}
,
{Red,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]}
,
{Blue,Thick, GeoPath[{First[spiritlandingsite],First[oplandingsite]}]}
,
{Purple,GeoPath[{"Parallel",40}],Cyan,GeoPath[{"Parallel",0}],Magenta,GeoPath[{"Parallel",-40}]}
},GeoRange->"World",ImageSize->Large],SwatchLegend[{Red,Yellow,Blue},{"Spirit","Opportunity","Geodesic path"}]]

Legended[GeoGraphics[
{
{Table[{Hue[r/30000],GeoCircle[First@spiritlandingsite,Quantity[r,"Kilometers"]]},{r,1000,10000,1000}]
}
,
{Yellow,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[oplandingsite]]&/@opposition)]}
,
{Red,PointSize[.02],Point[GeoPosition[#,Entity["Planet","Mars"]]&/@(GeoPositionENU[#,First[spiritlandingsite]]&/@spiritposition)]}
,
{Blue,Thick, GeoPath[{First[spiritlandingsite],First[oplandingsite]}]}
,
{Purple,GeoPath[{"Parallel",40}],Cyan,GeoPath[{"Parallel",0}],Magenta,GeoPath[{"Parallel",-40}]}
},GeoRange->"World",ImageSize->Large],SwatchLegend[{Red,Yellow,Blue},{"Spirit","Opportunity","Geodesic path"}]]

Recap

Create Maps

Many built-in GeoPrimitives

Construct custom Primitives

Create stylized maps

Analyze geo data with built-in Plots

Explore data with GeoGraphics

Geographic Visualization

Nirmal Malapaka, Wolfram Research

Join the Conversation #WolframTechConf