GeoData

Francisco Javier Rodríguez Arias
Wolfram Research South America

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf

ABSTRACT

In this presentation we will talk about the improvements of vector GeoGraphics, which was added in Version 12.2. We will also talk about the new upcoming data available in Wolfram Language related to geo entities such as “AdministrativeDivision”.

Outline

From raster to vector

Labels scale

New internal settings

Geographic entities

From raster to vector

In Version 12.2 we added support for vector GeoGraphics.

Use the GeoBackground option to access this new feature.

World map

styles={"StreetMap","VectorClassic","VectorBusiness","VectorMinimal","VectorMarketing","VectorDark","VectorMonochrome","VectorVintage","VectorWeb"};
Style[Grid[Partition[GeoGraphics[{Text[Framed[Style[#,FontSize->15,FontSlant->Italic],Background->GrayLevel[1,.75]],Scaled[{0,0}],{-1,-1}]},GeoRange->"World",ImageSize->Scaled[1/3],GeoProjection->"Mercator",GeoBackground->#]&/@styles,3]],TextAlignment->Center]

New default background

Up to Version 12.3, the default background has been a raster tile set. In Version 13 the labels are now vector, but graphics elements are still raster. This is part of the transition to full vector maps.

GeoGraphics["World"]

This also means that doing projections won’t distort labels:

GeoGraphics["World",GeoCenter->(Entity["Cusco", Entity["City",{"Cusco","Cusco","Peru"}], "Entity[\"City\", {\"Cusco\", \"Cusco\", \"Peru\"}]", "city"]),GeoProjection->"LambertAzimuthal"]

Before these maps used to look as:

GeoGraphics[]

GeoGraphics[GeoProjection->"LambertAzimuthal"]

New labels layer

This default background change required the addition of a new layer called “VectorLabels”.

GeoGraphics[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"]),GeoBackground->"VectorLabels"]

This is an optimized tileset containing only the labels, which means faster download and processing time.

Useful by its own, but more useful if combined with other layers.

List of backgrounds

Effectively, the new default background is combining the regular raster tileset without labels and the new vector labels layer.

GeoGraphics["World",GeoBackground->{"StreetMapNoLabels","VectorLabels"}]

Combining layers can be done with any of the available backgrounds.

A relief map with country borders.

GeoGraphics["World",GeoBackground->{"ReliefMap",GeoStyling[{"CountryBorders","Land"->Transparent,"Ocean"->Transparent,"Border"->Black}]},GeoProjection->"Robinson"]

Country borders with vector labels.

GeoGraphics["World",GeoBackground->{"CountryBorders","VectorLabels"},GeoProjection->{"Orthographic","Centering"->{60,60}},GeoZoomLevel->3,GeoGridLines->Automatic,ImageSize->1000]

Relief map with historical country borders.

GeoGraphics[GeoPosition[{28,87}],GeoRange->Quantity[2000,"Kilometers"],GeoBackground->{"ReliefMap",GeoStyling[{"CountryBorders",1500,"Land"->Transparent,"Ocean"->Transparent,"Border"->{Thick,Red}}]}]

Labels scale

By default now the map sets all the font and symbol sizes relative to map size. That means that resizing will keep the aspect of fonts.

GeoGraphics[ImageSize->100,GeoProjection->"Mercator"]

GeoGraphics[ImageSize->512,GeoProjection->"Mercator"]

In case that’s not wanted, it can be changed using an internal Method option.

GeoGraphics[ImageSize->512,GeoProjection->"Mercator",Method->{"VectorMapFontScaling"->False}]

New internal settings

Default background choice

If previous default background is needed, the value of the following variable can be changed to set it globally.

GeoGraphics`$GeoBackgroundType="Legacy";

GeoGraphics["World"]

Clearing the value will go back the default value.

GeoGraphics`$GeoBackgroundType=.

GeoGraphics`$GeoBackgroundType

GeoGraphics["World",GeoZoomLevel->1]

This can be set also using a Method option.

GeoGraphics["World",Method->{"GeoBackgroundType"->"Legacy"}]

Other internal method options

All the options in this section are internal options that may change in the future.

Change the relative size of fonts if needed

GeoGraphics["World",ImageSize->100,GeoProjection->"Mercator",Method->{"VectorMapSymbolSizeFactor"->0.35}]

GeoGraphics["World",ImageSize->512,GeoProjection->"Mercator",GeoZoomLevel->2,Method->{"VectorMapSymbolSizeFactor"->0.75}]

Change labels language

GeoGraphics["World",Method->{"VectorMapLabelName"->"name:ru"},GeoBackground->"VectorVintage"]

Avoid automatic rasterization of background

GeoGraphics[GeoRange->Entity["GeographicRegion","Europe"],Method->{"VectorMapLabelName"->"name:zh","VectorMapRasterize"->False},GeoBackground->"VectorWeb",GeoProjection->"LambertAzimuthal",GeoZoomLevel->3,RasterSize->1000]

Labels of a vector layer

Extract labels from a different style than VectorLabels to overlay with other backgrounds.

GeoGraphics["World",GeoBackground->{"Satellite",GeoStyling[{"CountryBorders","Land"->Transparent,"Ocean"->Transparent,"Border"->White}],GeoStyling["VectorDark",Method->{"VectorMapOnlyLabels"->True}]},GeoProjection->{"Orthographic","Centering"->{60,60}},GeoZoomLevel->2,GeoGridLines->Automatic,Background->Blue]

Geographic entities

Entities with only position

Grid[{Dataset@*Association/@Partition[Normal@,UpTo[17]]}]

Entities with polygon

Dataset@

New and updated data

“Building”

GeoHistogram[EntityValue["Building","Position"]]

“City”

Gradual addition of more polygons and updated population data.

citiesIL=GeoEntities[(Entity["Illinois, United States", Entity["AdministrativeDivision",{"Illinois","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Illinois\", \"UnitedStates\"}]", "administrative division"]), GeoVariant["City","Center"]];

populations=EntityValue[citiesIL,"Population"];

TextGrid[ReverseSortBy[EntityValue[citiesIL,"Population","Date"]//Tally,Last]]

GeoRegionValuePlot[citiesIL->Log10@QuantityMagnitude[populations],Epilog->{EdgeForm[{Thick,Black}],FaceForm[],Polygon[(Entity["Illinois, United States", Entity["AdministrativeDivision",{"Illinois","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Illinois\", \"UnitedStates\"}]", "administrative division"])]},AspectRatio->1]

“PrivateSchool” / “PublicSchool”

GeoHistogram[EntityValue["PrivateSchool","Position"],GeoRange->(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])]

GeoHistogram[EntityValue["PublicSchool","Position"],GeoRange->(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])]

“Island”

Added polygons to Island entities.

GeoGraphics[{{FaceForm[],EdgeForm[{Thick,Red}],Polygon[(Entity["La Palma", Entity["Island","LaPalma"], "Entity[\"Island\", \"LaPalma\"]", "island"])]},GeoMarker[(Entity["Cumbre Vieja", Entity["Volcano","CumbreVieja::j498d"], "Entity[\"Volcano\", \"CumbreVieja::j498d\"]", "volcano"]),"Volcano"]},GeoBackground->{"ReliefMap","VectorLabels"},AspectRatio->1/2,ImageSize->1000,GeoScaleBar->True]

GeoGraphics[{EdgeForm[{Thick,Blue}],Polygon[LinguisticAssistant]},GeoBackground->"Satellite"]

largestIslands=EntityList@EntityClass["Island",{(EntityProperty["total area", EntityProperty["Island","Area"], "EntityProperty[\"Island\", \"Area\"]"])->TakeLargest[2]}]

GeoDistance@@largestIslands

GeoGraphics[{{Red,GeoPath[largestIslands]},Blue,EdgeForm[{Thick,Darker@Blue}],Polygon/@largestIslands},GeoProjection->"LambertAzimuthal",GeoCenter->{90,0},GeoZoomLevel->3,GeoGridLines->Automatic,ImageSize->1200]

“AdministrativeDivision”

Ongoing improvement of administrative division polygons.

GeoGraphics[{EdgeForm[{Thick,Red}],FaceForm[],Polygon[(Entity["Barbados", Entity["Country","Barbados"], "Entity[\"Country\", \"Barbados\"]", "country"])["AdministrativeDivisions"]]}]

GeoGraphics[{EdgeForm[{Thick,Red}],FaceForm[],Polygon[(Entity["Puerto Rico", Entity["Country","PuertoRico"], "Entity[\"Country\", \"PuertoRico\"]", "country"])["AdministrativeDivisions"]]},ImageSize->Large]

We are also adding flags of administrative divisions.

(Entity["Lima, Lima, Peru", Entity["AdministrativeDivision",{"Lima","Lima","Peru"}], "Entity[\"AdministrativeDivision\", {\"Lima\", \"Lima\", \"Peru\"}]", "administrative division"])["Flag"]

GeoGraphics[{EdgeForm[Blue],GeoStyling[FaceForm[Transparent]],KeyValueMap[Mouseover[Polygon[#],Tooltip[{GeoStyling[FaceForm[Red]],Polygon[#]},Row[{Rotate[#,90Degree],Show[#2,ImageSize->{350}]}],TooltipDelay->1]]&,EntityValue[Entity["Country","Liechtenstein"]["AdministrativeDivisions"],"Flag","EntityAssociation"]]},ImageSize->Large,AspectRatio->1]