GeoGraphics

Since Version 10.0 of the Wolfram Language, (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) allows a simple and general way of constructing maps of the surface of the Earth and other celestial bodies. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) combines the powerful (RefLink[Graphics, paclet:ref/Graphics]) functionality with fast and highly precise geodetic computations and also direct access to the Wolfram Knowledgebase through the (RefLink[Entity, paclet:ref/Entity]) framework.

The fundamental new ingredient in (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) with respect to standard 2D (RefLink[Graphics, paclet:ref/Graphics]) is the fact that the surface of the Earth is curved and therefore must be distorted to produce a flat map (on a piece of paper or the computer screen). This always requires a choice of a cartographic projection, a function that determines how points on the curved surface are mapped to points on the flat map. The (RefLink[GeoProjectionData, paclet:ref/GeoProjectionData]) paclet provides a large collection of projections.

(RefLink[GeoGraphics, paclet:ref/GeoGraphics]) also introduces new graphical primitives like (RefLink[GeoPath, paclet:ref/GeoPath]), (RefLink[GeoDisk, paclet:ref/GeoDisk]), and (RefLink[GeoHemisphere, paclet:ref/GeoHemisphere]), adapted to the Earth's curvature, and even time-dependent geo primitives like (RefLink[DayHemisphere, paclet:ref/DayHemisphere]) and (RefLink[DayNightTerminator, paclet:ref/DayNightTerminator]).

The (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) functionality can easily access the Wolfram Knowledgebase to obtain geographical information using the (RefLink[Entity, paclet:ref/Entity]) framework, providing homogeneous access to a large number of properties about dozens of types of objects, from countries and cities to bridges, earthquakes, and artificial satellites.

(RefLink[GeoGraphics, paclet:ref/GeoGraphics]) is also fully integrated with the geodesy functionality of the Wolfram Language, extensively updated for Version 10.0. This functionality is now much faster and precise to millimeters on the surface of the ellipsoidal Earth. (RefLink[GeoPosition, paclet:ref/GeoPosition]) allows specification of any position on the Earth, in any of the large collection of ellipsoids of (RefLink[GeodesyData, paclet:ref/GeodesyData])—for example, the WGS84 reference used by GPS satellites.

This tutorial provides an introduction to (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) and its associated functions. The tutorial starts by showing how to easily construct maps of arbitrary regions or geographical entities, letting (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) choose appropriate coordinate ranges, projections, etc. for you. Then it explains how you can choose all those options to fine-tune the maps to your needs.

Basic Mapping

The simplest and most important operation is obtaining a map of a given region of interest. The (RefLink[Entity, paclet:ref/Entity]) framework provides a fast and homogeneous way to obtain the required positional information. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will then choose an adequate projection, generally the "Mercator" projection for small to medium scales (under 2000 km diagonally, approximately).

Main mapping command.

A map of France. Type CTRL= and then the word "France" to get the entity:

GeoGraphics[(Entity["France", Entity["Country","France"], "Entity[\"Country\", \"France\"]", "country"])]

A map of New York City:

GeoGraphics[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"])]

With no argument specification, (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) gives by default a map of your local area, as determined by (RefLink[$GeoLocation, paclet:ref/$GeoLocation]), with a radius of around 10 miles.

The current (RefLink[$GeoLocation, paclet:ref/$GeoLocation]), returned as a (RefLink[GeoPosition, paclet:ref/GeoPosition])[{lat,lon}] object:

$GeoLocation

A map around that geo location:

GeoGraphics[]

Maps of the whole world are obtained by using the option value (RefLink[GeoRange, paclet:ref/GeoRange])->"World". Such maps are given by default using the so-called "Equirectangular" projection, in which the horizontal axis is exactly longitude and the vertical axis is exactly latitude. Similarly, (RefLink[GeoRange, paclet:ref/GeoRange])->(StringTypeLink["Country", paclet:ref/interpreter/Country]) gives a map of your country, and (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will choose a projection that minimizes distortion of the map.

A map of the world:

GeoGraphics[GeoRange->"World"]

A map of your country, again as determined by (RefLink[$GeoLocation, paclet:ref/$GeoLocation]):

GeoGraphics[GeoRange->"Country"]

Discover which projection was used:

AbsoluteOptions[%,GeoProjection]

Or which ranges of latitude and longitude (in degrees) were selected:

AbsoluteOptions[%%,GeoRange]

The options (RefLink[GeoRange, paclet:ref/GeoRange]), (RefLink[GeoRangePadding, paclet:ref/GeoRangePadding]), (RefLink[GeoCenter, paclet:ref/GeoCenter]), and (RefLink[GeoZoomLevel, paclet:ref/GeoZoomLevel]) allow multiple ways of specifying the regions of interest. They will be studied in detail later on in this tutorial.

Give explicitly the ranges of latitude and longitude:

GeoGraphics[GeoRange->{{48.7,49},{2,2.5}}]

Add 10 kilometers of padding in all directions:

GeoGraphics[GeoRange->{{48.7,49},{2,2.5}},GeoRangePadding->Quantity[10,"Kilometers"]]

Specify a center and a zoom level:

Table[GeoGraphics[GeoCenter->(Entity["Eiffel Tower", Entity["Building","EiffelTower::5h9w8"], "Entity[\"Building\", \"EiffelTower::5h9w8\"]", "building"]),GeoZoomLevel->zoom],{zoom,{1,5,8,11,15,18}}]

You can also change the zoom level of an image without changing its geo range. This results in increasingly more detail:

Table[GeoGraphics[GeoRange->{{48.71,49.02},{2.12,2.55}},GeoZoomLevel->zoom],{zoom,{7,8,9,10,11,12}}]

But then maps are increasingly larger in size:

ByteCount/@%

So far maps have been produced showing the geo background image corresponding to a given region. The (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) language provides a variety of objects, called geo primitives, that can be placed on the map. These geo primitives can be point-like ((RefLink[Point, paclet:ref/Point]) or (RefLink[GeoMarker, paclet:ref/GeoMarker])), line-like ((RefLink[GeoPath, paclet:ref/GeoPath]), (RefLink[GeoCircle, paclet:ref/GeoCircle]), (RefLink[Line, paclet:ref/Line]), ...), or area-like ((RefLink[GeoDisk, paclet:ref/GeoDisk]), (RefLink[GeoHemisphere, paclet:ref/GeoHemisphere]), (RefLink[Polygon, paclet:ref/Polygon]), ...).

Place markers at the capitals of South America:

GeoGraphics[GeoMarker[(EntityClass["South America", EntityClass["Country","SouthAmerica"], "EntityClass[\"Country\", \"SouthAmerica\"]", "countries"])["CapitalCity"]],GeoRangePadding->(Quantity[1000, "mi", miles, "Miles"]),GeoProjection->"Equirectangular"]

The geodesic curve from Santiago de Chile to Madrid. It is not a straight line in this projection:

GeoGraphics[GeoPath[{(Entity["Santiago", Entity["City",{"Santiago","Metropolitana","Chile"}], "Entity[\"City\", {\"Santiago\", \"Metropolitana\", \"Chile\"}]", "city"]),(Entity["Madrid", Entity["City",{"Madrid","Madrid","Spain"}], "Entity[\"City\", {\"Madrid\", \"Madrid\", \"Spain\"}]", "city"])}]]

A disk of 60 miles around Chicago, by default with low opacity so that it can be seen through:

GeoGraphics[GeoDisk[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[60,"Miles"]]]

A polygon covering the United States, again with default low opacity:

GeoGraphics[Polygon[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])]]

There are multiple ways to stylize a map. You can add parallels and meridians, a scale bar, or change the geo background to depict a relief map of elevation data or a contour plot. You can change colors and opacities, or even place images inside 2D geo primitives like geo disks or polygons—and many more options.

A map of Spain and Portugal with latitude and longitude lines separated 1 degree and a scale bar in kilometers:

GeoGraphics[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"]),GeoGridLines->Quantity[1,"AngularDegrees"],GeoScaleBar->"Metric"]

A relief map of the same area showing geo elevation data:

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

Place the Spanish flag over the country:

GeoGraphics[{GeoStyling[{"Image",(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"])["Flag"]}],Polygon[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"])]}]

Maps of other celestial bodies (planets and moons) are also possible.

The near side of the Moon (longitude 0 is defined to be oriented toward Earth):

GeoGraphics[GeoRange->All,GeoModel->(Entity["Moon", Entity["PlanetaryMoon","Moon"], "Entity[\"PlanetaryMoon\", \"Moon\"]", "planetary moon"]),GeoProjection->"Orthographic",Background->Black]

A map of the area around Olympus Mons on Mars:

GeoGraphics[(Entity["Olympus Mons", Entity["SolarSystemFeature","OlympusMonsMars"], "Entity[\"SolarSystemFeature\", \"OlympusMonsMars\"]", "solar system feature"]),GeoRange->Quantity[400,"Miles"],GeoModel->(Entity["Mars", Entity["Planet","Mars"], "Entity[\"Planet\", \"Mars\"]", "planet"])]

Geographical Locations and Computations

GeoPosition and Geo Entities

Specific locations on the Earth are given as (RefLink[GeoPosition, paclet:ref/GeoPosition])[{lat,lon}] objects, with latitude and longitude coordinates given in degrees, with standard conventions. (RefLink[GeoPosition, paclet:ref/GeoPosition]) can also convert other forms of input into that notation for convenience, including geographical (RefLink[Entity, paclet:ref/Entity]) and (RefLink[EntityClass, paclet:ref/EntityClass]) objects.

Location specification.

The coordinates of the North Pole:

GeoPosition[{90,0}]

They can also be obtained as follows:

GeoPosition["NorthPole"]

Coordinates can also be provided in degree-minute-second (DMS) string form:

GeoPosition["34d 25m 7.5s S, 123° 56' 32.12'' E"]

GeoPosition[{"34d 25m 7.5s S","123° 56' 32.12'' E"}]

Give angles as (RefLink[Quantity, paclet:ref/Quantity]) objects, in any unit:

GeoPosition[{Quantity[1,"Radians"],Quantity[123.456,"AngularDegrees"]}]

Convert geographical (RefLink[Entity, paclet:ref/Entity]) data into numeric coordinates:

GeoPosition[Entity["City",{"London","GreaterLondon","UnitedKingdom"}]]

GeoPosition[(Entity["London", Entity["City",{"London","GreaterLondon","UnitedKingdom"}], "Entity[\"City\", {\"London\", \"GreaterLondon\", \"UnitedKingdom\"}]", "city"])]

Internally, (RefLink[GeoPosition, paclet:ref/GeoPosition]) calls (RefLink[EntityValue, paclet:ref/EntityValue]) to get that information:

EntityValue[(Entity["London", Entity["City",{"London","GreaterLondon","UnitedKingdom"}], "Entity[\"City\", {\"London\", \"GreaterLondon\", \"UnitedKingdom\"}]", "city"]),"Position"]

(RefLink[GeoPosition, paclet:ref/GeoPosition]) can also handle arrays of coordinates. This is useful for working efficiently with many points at the same time. Points of the array can be given in different notations, and (RefLink[GeoPosition, paclet:ref/GeoPosition]) will convert them all to numeric coordinates.

Convert a list of entities:

EntityList[(EntityClass["Acropolis of Athens", EntityClass["Building","AcropolisAthens"], "EntityClass[\"Building\", \"AcropolisAthens\"]", "buildings"])]

GeoPosition[%]

First[%]

An (RefLink[EntityClass, paclet:ref/EntityClass]) object is interpreted as representing the list of its members:

GeoPosition[(EntityClass["Acropolis of Athens", EntityClass["Building","AcropolisAthens"], "EntityClass[\"Building\", \"AcropolisAthens\"]", "buildings"])]

Extract geo location EXIF information from a picture:

GeoPosition[]

Convert different types of objects simultaneously:

GeoPosition[{(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"]),{48.86,2.34},{(QuantityPostfix[48.86, "°", degrees, "AngularDegrees"]),(QuantityPostfix[2.34, "°", degrees, "AngularDegrees"])},{"48°51'36.''N","2°20'24.''E"}}]//First

Distances and Bearings (Angles)

Together with the coordinate positions of given locations, it is generally important to know distances between any two of them, as well as the compass direction you need to follow to go from one to another. Distances are computed along geodesics, i.e. basically the shortest curve between two positions. Angles are given as bearings, namely the angle from the north to that geodesic line, measured clockwise in degrees. In the Wolfram Language, distances on the surface of the Earth are measured with (RefLink[GeoDistance, paclet:ref/GeoDistance]), and bearings are computed with (RefLink[GeoDirection, paclet:ref/GeoDirection]).

Geodesic displacements.

Take the approximate center positions of two cities:

newyork=GeoPosition[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"])]
paris=GeoPosition[(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"])]

This is the geodesic between those points:

GeoGraphics[GeoPath[{newyork,paris}],GeoBackground->"ReliefMap"]

Distance between them:

dist=GeoDistance[newyork,paris]

The result is given as a (RefLink[Quantity, paclet:ref/Quantity]) object with units determined by your (RefLink[$UnitSystem, paclet:ref/$UnitSystem]):

$UnitSystem

To change to any other unit, use (RefLink[UnitConvert, paclet:ref/UnitConvert]):

UnitConvert[dist,"Kilometers"]

You can also modify the unit system required in the (RefLink[GeoDistance, paclet:ref/GeoDistance]) call itself:

GeoDistance[newyork,paris,UnitSystem->"Metric"]

You can use the (RefLink[Entity, paclet:ref/Entity]) objects directly to compute distances, but then the Wolfram Language functions try to use polygonal information, when available, rather than purely point-like positions. That means that (RefLink[GeoDistance, paclet:ref/GeoDistance]) will return the smallest possible distance when considering all points of the polygons.

Distance between the borders of New York and Paris:

borderdist=GeoDistance[LinguisticAssistant,LinguisticAssistant]

It is smaller than the distance obtained before from center to center:

dist-borderdist

The distance between centers can also be computed using the (RefLink[DistanceFunction, paclet:ref/DistanceFunction]) option of (RefLink[GeoDistance, paclet:ref/GeoDistance]):

GeoDistance[LinguisticAssistant,LinguisticAssistant,DistanceFunction->"Center"]

This map shows the position of the center with respect to the polygon of the city:

GeoGraphics[{Polygon[LinguisticAssistant],GeoMarker[newyork]}]

Bearings are computed with (RefLink[GeoDirection, paclet:ref/GeoDirection]). Currently this function does not handle polygonal information, only positional information. A warning message is issued when appropriate.

This is the bearing of the geodesic from New York to Paris, measured at New York:

GeoDirection[LinguisticAssistant,LinguisticAssistant]

Express the result in DMS form:

DMSString[%]

(RefLink[GeoDirection, paclet:ref/GeoDirection]) always uses center positions; hence, the previous result equals the following:

%%==GeoDirection[newyork,paris]

This is the bearing of the same geodesic, but now from Paris to New York:

GeoDirection[(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"]),(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"])]

(RefLink[GeoDisplacement, paclet:ref/GeoDisplacement]) reports both distance (in meters) and bearing (in degrees):

GeoDisplacement[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"])]

Knowing the geo displacement and the initial position, it is possible to recover the final position:

GeoDestination[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"]),%]

{%,GeoPosition[(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"])]}

Relational Positioning

Given a location, it is frequently important to know instances of a particular type of entity that are at a short distance from it. This is the role of the function (RefLink[GeoNearest, paclet:ref/GeoNearest]). If the locations or entities are extended, you may also be interested in inclusion relations.

Distance relations among entities and locations.

Find the nearest ocean or sea to your current location:

GeoNearest["Ocean",Here]

Find the four nearest countries to a given location, sorted by distance to the border:

GeoNearest["Country",GeoPosition[{50,20}],4]

Find all cities within 10 miles around Bath, UK, also sorted by distance:

GeoNearest["City",(Entity["Bath", Entity["City",{"Bath","BathAndNorthEastSomerset","UnitedKingdom"}], "Entity[\"City\", {\"Bath\", \"BathAndNorthEastSomerset\", \"UnitedKingdom\"}]", "city"]),{All,Quantity[10,"Miles"]}]

Other relations are essentially derivates of (RefLink[GeoNearest, paclet:ref/GeoNearest]). For example, (RefLink[GeoIdentify, paclet:ref/GeoIdentify]) returns all entities containing a given location, by default your current geo location.

All available entities containing the current geo location:

GeoIdentify[]

They are entities of various types:

EntityTypeName/@%

All administrative divisions containing Rome:

GeoIdentify["AdministrativeDivision",(Entity["Rome", Entity["City",{"Rome","Lazio","Italy"}], "Entity[\"City\", {\"Rome\", \"Lazio\", \"Italy\"}]", "city"])]

Vice versa, (RefLink[GeoEntities, paclet:ref/GeoEntities]) lists the entities contained in a given extended entity.

Level 2 administrative divisions of an administrative division of level 1:

GeoEntities[(Entity["Toscana, Italy", Entity["AdministrativeDivision",{"Toscana","Italy"}], "Entity[\"AdministrativeDivision\", {\"Toscana\", \"Italy\"}]", "administrative division"]),"AdministrativeDivision2"]

Famous buildings in Dallas:

GeoEntities[(Entity["Dallas", Entity["City",{"Dallas","Texas","UnitedStates"}], "Entity[\"City\", {\"Dallas\", \"Texas\", \"UnitedStates\"}]", "city"]),"Building"]

The function (RefLink[GeoWithinQ, paclet:ref/GeoWithinQ]) checks inclusion of a geographical location (extended or not) inside a geographical region.

Check that Chicago is inside the state of Illinois:

GeoWithinQ[(Entity["Illinois, United States", Entity["AdministrativeDivision",{"Illinois","UnitedStates"}], "Entity[\"AdministrativeDivision\", {\"Illinois\", \"UnitedStates\"}]", "administrative division"]),(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"])]

The island of Tenerife is in the Atlantic Ocean, not in the Mediterranean Sea:

GeoWithinQ[(Entity["Atlantic Ocean", Entity["Ocean","AtlanticOcean"], "Entity[\"Ocean\", \"AtlanticOcean\"]", "ocean"]),(Entity["Tenerife", Entity["Island","Tenerife"], "Entity[\"Island\", \"Tenerife\"]", "island"])]

GeoWithinQ[(Entity["Mediterranean Sea", Entity["Ocean","MediterraneanSea"], "Entity[\"Ocean\", \"MediterraneanSea\"]", "ocean"]),(Entity["Tenerife", Entity["Island","Tenerife"], "Entity[\"Island\", \"Tenerife\"]", "island"])]

All these computations are sent to the Wolfram geo server, and results are then downloaded from it. In some cases it is possible to perform the operations locally using (RefLink[Nearest, paclet:ref/Nearest]).

This variable reports your current country:

country=$GeoLocationCountry

Take the points of the boundary of its polygon:

points=EntityValue[country,"Polygon"][[1]]

Find out which of those points is closest to your current location:

Nearest[points,Here][[1]]

Draw the geodesic as an arrow:

GeoGraphics[{Polygon[country],Red,Arrow[GeoPath[{Here,%}]]}]

Geo Entity Variants

Sometimes you want a map of the main area of a country, without including smaller islands or dependencies that may be very far away. Or you may need a map including all territories. In those cases, the Wolfram Language specifies the additional information using the head (RefLink[GeoVariant, paclet:ref/GeoVariant]).

Geo entity variants.

The default map of the US only includes the conterminous states:

GeoGraphics[{EdgeForm[Thick],Polygon[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])]}]

This map includes all areas:

GeoGraphics[{EdgeForm[Thick],Polygon[GeoVariant[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"]),"AllAreas"]]}]

Something intermediate is given by the variant "PrincipalArea" and its downsampled form "SimplifiedArea". In this case the US map includes Alaska and Hawaii:

GeoGraphics[{EdgeForm[Thick],Polygon[GeoVariant[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"]),"SimplifiedArea"]]}]

The variant used by default in the maps is called "DefaultMapArea":

GeoGraphics[{EdgeForm[Thick],Polygon[GeoVariant[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"]),"DefaultMapArea"]]}]

Other geo functions can also handle geo entity variants. However, the defaults are not necessarily the same. For example, the default variants for (RefLink[GeoNearest, paclet:ref/GeoNearest]) are sometimes larger than the corresponding defaults in (RefLink[GeoGraphics, paclet:ref/GeoGraphics]).

The default geo variant in (RefLink[GeoNearest, paclet:ref/GeoNearest]) is "PrincipalArea":

GeoNearest["Country",(Entity["Netherlands", Entity["Country","Netherlands"], "Entity[\"Country\", \"Netherlands\"]", "country"]),4]

Therefore, the result is different when you change the variant:

GeoNearest["Country",GeoVariant[(Entity["Netherlands", Entity["Country","Netherlands"], "Entity[\"Country\", \"Netherlands\"]", "country"]),"AllAreas"],4]

$GeoLocation and FindGeoLocation

The Wolfram Language can determine your approximate location using GeoIP information. This is done with (RefLink[FindGeoLocation, paclet:ref/FindGeoLocation]), and the result is stored in the global variable (RefLink[$GeoLocation, paclet:ref/$GeoLocation]). The variable (RefLink[Here, paclet:ref/Here]) is an alternative way of accessing the current geo location. Many of the functions related to (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will default to that position when location information is not provided. You can manually set (RefLink[$GeoLocation, paclet:ref/$GeoLocation]) to any other position you want, and then your Wolfram Language session will behave as if you were at that position. When the value of (RefLink[$GeoLocation, paclet:ref/$GeoLocation]) is set, the variables (RefLink[$GeoLocationCity, paclet:ref/$GeoLocationCity]) and (RefLink[$GeoLocationCountry, paclet:ref/$GeoLocationCountry]) are automatically assigned to the city and country containing (RefLink[$GeoLocation, paclet:ref/$GeoLocation]), or the nearest possible city and country. Note that changing your (RefLink[$GeoLocation, paclet:ref/$GeoLocation]) does not automatically change (RefLink[$TimeZone, paclet:ref/$TimeZone]).

Current location.

The current (RefLink[$GeoLocation, paclet:ref/$GeoLocation]):

$GeoLocation

This is an equivalent object:

Here

Therefore, (RefLink[GeoGraphics, paclet:ref/GeoGraphics])[] defaults to that position:

GeoGraphics[]

Change (RefLink[$GeoLocation, paclet:ref/$GeoLocation]) to some other position:

$GeoLocation=GeoPosition[(Entity["New York City", Entity["City",{"NewYork","NewYork","UnitedStates"}], "Entity[\"City\", {\"NewYork\", \"NewYork\", \"UnitedStates\"}]", "city"])]

Now local maps are maps of New York:

GeoGraphics[]

Change back to your current location:

$GeoLocation=FindGeoLocation[]

Use (RefLink[FindGeoLocation, paclet:ref/FindGeoLocation]) to find approximate locations for addresses.

Ranges of Coordinates and Projections

Latitude and Longitude: GeoRange

The most general way of specifying the region covered by a map in latitude and longitude coordinates is using the option (RefLink[GeoRange, paclet:ref/GeoRange])->{{(Subscript[lat, min]),(Subscript[lat, max])},{(Subscript[lon, min]),(Subscript[lon, max])}}. As usual, the angles are given in degrees, with standard conventions. Any other specification of a geo region is eventually converted internally into one such range specification, perhaps extended as determined by the (RefLink[GeoRangePadding, paclet:ref/GeoRangePadding]) option.

Geo range specification.

(RefLink[GeoBounds, paclet:ref/GeoBounds]) computes the latitude and longitude ranges of any geographical region:

bounds=GeoBounds[(Entity["France", Entity["Country","France"], "Entity[\"Country\", \"France\"]", "country"])]

A map using the "Equirectangular" projection will show that region with axes corresponding to those coordinate ranges. When using a specific numerical geo range, there is no padding added:

GeoGraphics[GeoRange->bounds,GeoProjection->"Equirectangular",Frame->True]

The "World" geo range corresponds to the whole world, by default {{-90,90},{-180,180}}:

GeoGraphics[GeoRange->"World",Frame->True]

The two halves of the world:

{GeoGraphics[GeoRange->{{-90,90},{-90,90}},Frame->True],GeoGraphics[GeoRange->{{-90,90},{90,270}},Frame->True]}

Longitudes {(Subscript[lon, min]),(Subscript[lon, max])} can be given in any determination. (Subscript[lon, max]) is adjusted modulo 360 to be larger than (Subscript[lon, min]):

GeoGraphics[GeoRange->{{-90,90},{90,-90}},Frame->True]

The determination used in the longitude range is preserved in the result, though only for cylindrical projections (see types of projections below):

GeoGraphics[GeoRange->{{-90,90},{1000,1180}},Frame->True]

GeoCenter

An alternative way to provide a geo range is to give a center point and a distance radius, defining a geo disk on the Earth's surface. The geo range is then the rectangle in {lat,lon} coordinates that fully encloses that geo disk. This is done by using the options (RefLink[GeoCenter, paclet:ref/GeoCenter]) and (RefLink[GeoRange, paclet:ref/GeoRange]), the latter now containing only the distance radius.

Geo center specification.

A map of the area 100 miles around Dublin:

GeoGraphics[GeoCenter->LinguisticAssistant,GeoRange->Quantity[100,"Miles"]]

The (RefLink[GeoCenter, paclet:ref/GeoCenter]) option can also be used to select the center point of a map whose (RefLink[GeoRange, paclet:ref/GeoRange]) was automatically obtained from the input. If the option (RefLink[GeoRange, paclet:ref/GeoRange]) explicitly specifies a region, it will always override any other information provided by (RefLink[GeoCenter, paclet:ref/GeoCenter]).

A map of Germany centered at Munich:

GeoGraphics[Polygon[(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"])],GeoCenter->(Entity["Munich", Entity["City",{"Munich","Bavaria","Germany"}], "Entity[\"City\", {\"Munich\", \"Bavaria\", \"Germany\"}]", "city"])]

If the (RefLink[GeoRange, paclet:ref/GeoRange]) option is explicit, then (RefLink[GeoCenter, paclet:ref/GeoCenter]) will be ignored:

GeoGraphics[Polygon[(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"])],GeoCenter->(Entity["Munich", Entity["City",{"Munich","Bavaria","Germany"}], "Entity[\"City\", {\"Munich\", \"Bavaria\", \"Germany\"}]", "city"]),GeoRange->(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"])]

(RefLink[GeoCenter, paclet:ref/GeoCenter]) also allows you to choose the center longitude for the "World" geo range:

GeoGraphics[GeoRange->"World",GeoCenter->100]

Other Specifications of the Map Region

(RefLink[GeoGraphics, paclet:ref/GeoGraphics]) accepts location information in input, not inside geo primitives. That information contributes to the specification of the ranges of the map, but nothing is rendered on the map associated to it. Again, when only center information is available, the default scale of the map is approximately 10 miles in radius.

A map around a given position. Nothing is drawn on the map:

GeoGraphics[GeoPosition[{41.9,12.5}]]

This shows the scale of the map:

GeoGraphics[{Blue,GeoCircle[GeoPosition[{41.9,12.5}],Quantity[10,"Miles"]]},GeoScaleBar->"Imperial"]

You can change the default range to anything you want:

GeoGraphics[GeoPosition[{41.9,12.5}],GeoRange->Quantity[100,"Kilometers"]]

When using an (RefLink[Entity, paclet:ref/Entity]) object, (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) consults with (RefLink[EntityValue, paclet:ref/EntityValue]) about whether position and polygon information exists. If a geo polygon can be obtained, then that means there is also a clear sense of scale. If a polygon cannot be obtained, then you proceed with the center position and the default scale as before.

This is the polygon surrounding San Francisco. It contains a (RefLink[GeoPosition, paclet:ref/GeoPosition]) object with multiple {lat,lon} pairs inside:

EntityValue[(Entity["Los Angeles", Entity["City",{"LosAngeles","California","UnitedStates"}], "Entity[\"City\", {\"LosAngeles\", \"California\", \"UnitedStates\"}]", "city"]),"Polygon"]

This map is scaled to contain that polygon:

GeoGraphics[(Entity["Los Angeles", Entity["City",{"LosAngeles","California","UnitedStates"}], "Entity[\"City\", {\"LosAngeles\", \"California\", \"UnitedStates\"}]", "city"])]

But this other map has the standard scale of about 10 miles:

GeoGraphics[GeoPosition[(Entity["Los Angeles", Entity["City",{"LosAngeles","California","UnitedStates"}], "Entity[\"City\", {\"LosAngeles\", \"California\", \"UnitedStates\"}]", "city"])]]

Currently there is no polygon information for Rome, and hence these two maps cover identical ranges:

With[{rome=LinguisticAssistant},AbsoluteOptions[#,GeoRange]&/@{GeoGraphics[rome],GeoGraphics[GeoPosition[rome]]}]

Projected Coordinates

For large areas of the world, the default projection is "Equirectangular", in which the map coordinates are directly longitude and latitude. However, for smaller areas of the world it is more convenient to choose other projections, to decrease distortion. The map coordinates do not then have immediate angular meaning. For example, for low scales (approximately under 2000 km diagonally) the default projection is "Mercator", which preserves shapes. In this case, the horizontal axis still represents longitude, but the vertical axis is not latitude anymore.

The Mercator projection is frequently used in map services on the internet. However, it highly distorts distances and areas near the poles. In fact, the poles are mapped at infinite distance along the vertical axes, and therefore the Mercator projection cannot show the whole world in a map. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) allows you to choose the projection needed, and the paclet (RefLink[GeoProjectionData, paclet:ref/GeoProjectionData]) provides one of the most extensive collections of projections available. When no explicit projection is indicated, (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will choose an appropriate projection for you, based on the scale and center of the map.

Geo projection specification.

These are the latitude and longitude coordinates of Berlin:

berlin=GeoPosition[(Entity["Berlin", Entity["City",{"Berlin","Berlin","Germany"}], "Entity[\"City\", {\"Berlin\", \"Berlin\", \"Germany\"}]", "city"])]

However, a map of Germany in the Mercator projection shows Berlin with different coordinates:

map=GeoGraphics[GeoMarker[berlin],GeoRange->(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"]),Frame->True]

This is the projection used in the map, a Mercator projection, with adapted "Centering" and "GridOrigin" parameters so that the horizontal axis still represents true longitude:

proj=GeoProjection/.AbsoluteOptions[map,GeoProjection]

(RefLink[GeoGridPosition, paclet:ref/GeoGridPosition]) will give you the exact coordinates in the projection chosen:

GeoGridPosition[berlin,proj]

You can now force that projection in the same map, obtaining the same result:

GeoGraphics[GeoMarker[berlin],GeoRange->(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"]),GeoProjection->proj,Frame->True]

Or in another map, whose default projection would be quite different:

GeoGraphics[GeoMarker[berlin],GeoRange->(EntityClass["Western Europe", EntityClass["Country","WesternEurope"], "EntityClass[\"Country\", \"WesternEurope\"]", "countries"]),GeoProjection->proj,Frame->True,GeoGridLines->Automatic]

For intermediate-scale maps, the default projection is "LambertAzimuthal". The coordinate values do not then have an immediate meaning in terms of latitude or longitude angles.

A map of the United States. Note how the northern boundary (approximately parallel 49) is curved:

map=GeoGraphics[Polygon[LinguisticAssistant],Frame->True]

AbsoluteOptions[map,GeoProjection]

In that projection, neither parallels nor meridians are straight lines:

map=GeoGraphics[Polygon[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])],Frame->True,GeoGridLines->(QuantityPostfix[5, "°", degrees, "AngularDegrees"]),GeoGridLinesStyle->Gray]

Compare to a Mercator map of the United States, displaying the same parallels and meridians:

GeoGraphics[Polygon[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])],Frame->True,GeoGridLines->(QuantityPostfix[5, "°", degrees, "AngularDegrees"]),GeoGridLinesStyle->Gray,GeoProjection->"Mercator",GeoBackground->"StreetMapNoLabels"]

Introduction to Geo Projections

There are many functions and parameters to control cartographic projections and projected coordinates in the Wolfram Language. This subsection gives a brief summary of them. See the documentation of (RefLink[GeoProjection, paclet:ref/GeoProjection]) and (RefLink[GeoProjectionData, paclet:ref/GeoProjectionData]) for more detailed information.

Cartographic projections are functions of points on the surface of the Earth onto points on the surface of a flat map, a process that always involves some form of distortion. There are many possible choices of such functions, and the actual choice must be determined by the practical and aesthetic properties of the result, like minimizing distortion in some sense. This leads to several possible classifications of projections.

Many projections are defined using geometric methods of mapping points on a sphere to points on a tangent plane ("azimuthal" projections), a tangent cylinder ("cylindrical" projections), or a tangent cone ("conic" projections). Formulas can be easily generalized for the respective secant cases. In their basic cases, the axes of cylinders and cones are aligned with the polar axis of the sphere.

Cartographic projections are relevant at all scales, but their differences are clearer when using world maps. This subsection will only use examples of world maps.

Available cylindrical projections:

GeoProjectionData["Cylindrical"]

In cylindrical projections, parallels and meridians are straight orthogonal lines:

GeoGraphics[GeoRange->"World",GeoProjection->"MillerCylindrical",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"CylindricalEqualArea",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"LambertCylindrical",GeoGridLines->Automatic]

Available conic projections:

GeoProjectionData["Conic"]

In conic projections, meridians are straight lines and parallels are circle arcs:

GeoGraphics[GeoRange->"World",GeoProjection->"Albers",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"ConicEquidistant",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"LambertConicConformal",GeoGridLines->Automatic]

Available azimuthal projections:

GeoProjectionData["Azimuthal"]

Examples of azimuthal projections, centered at various points by default:

GeoGraphics[GeoRange->"World",GeoProjection->"Orthographic",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"LambertAzimuthal",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"Airy",GeoGridLines->Automatic]

There are multiple variations of those basic types of projections. For example, if parallels are kept as horizontal straight lines but meridians are allowed to be arbitrary curves, the result is the family of "pseudo-cylindrical" projections. Projections that do not naturally have a particular type are usually classified as "miscellaneous".

Available pseudo-cylindrical projections:

GeoProjectionData["PseudoCylindrical"]

GeoGraphics[GeoRange->"World",GeoProjection->"Mollweide",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"WinkelTripel",GeoGridLines->Automatic]

GeoGraphics[GeoRange->"World",GeoProjection->"Sinusoidal",GeoGridLines->Automatic]

An example of a miscellaneous projection:

GeoGraphics[GeoRange->"World",GeoProjection->"Armadillo",GeoGridLines->Automatic]

Another important way of classifying projections is by using the geometric properties they preserve, mainly angles ("conformal" projections), distances ("equidistant" projections), or areas ("equal-area" or "equivalent" or "eumorphic" projections). No projection can preserve everything simultaneously.

The Mercator projection is the only cylindrical and conformal projection:

GeoProjectionData["Mercator","Classes"]

The Albers projection is conic and equal area:

GeoProjectionData["Albers","Classes"]

The stereographic projection is azimuthal and conformal and is also constructed via perspective mapping:

GeoProjectionData["Stereographic","Classes"]

Geo projections have parameters. (RefLink[GeoProjectionData, paclet:ref/GeoProjectionData])[projname] gives the default values of the projection parameters.

Choose the centering point of a projection:

GeoGraphics[GeoRange->"World",GeoProjection->{"Orthographic","Centering"->(Entity["Buenos Aires", Entity["City",{"BuenosAires","BuenosAires","Argentina"}], "Entity[\"City\", {\"BuenosAires\", \"BuenosAires\", \"Argentina\"}]", "city"])},GeoGridLines->Automatic]

Choose the secant parallels in a conic projection:

GeoGraphics[GeoRange->"World",GeoProjection->{"Albers","StandardParallels"->{-15,35}},GeoGridLines->Automatic]

Change the default map scale to use kilometers (true distance only on the equator for the Mercator projection):

GeoGraphics[GeoRange->"World",GeoProjection->{"Mercator","ReferenceModel"->6378.14},GeoGridLines->Automatic,Frame->True]

Padding

The (RefLink[GeoRange, paclet:ref/GeoRange]) option with explicit numeric values of latitude and longitude ranges returns a map of exactly the region requested. If the projection is not cylindrical, then the borders of the map will be curved lines, corresponding to the specified parallels and meridians.

Geo range padding specification.

These are the latitude and longitude limits of the mainland United States:

bounds=GeoBounds[(Entity["United States", Entity["Country","UnitedStates"], "Entity[\"Country\", \"UnitedStates\"]", "country"])]

GeoGraphics[GeoRange->bounds,GeoGridLines->Automatic,Frame->True]

Use (RefLink[GeoRangePadding, paclet:ref/GeoRangePadding])->None to restrict to the actual geo range of the US:

GeoGraphics[GeoRange->bounds,GeoRangePadding->None,GeoGridLines->Automatic,Frame->True]

A map specified by a geographical (RefLink[Entity, paclet:ref/Entity]) or (RefLink[EntityClass, paclet:ref/EntityClass]) object is constructed by first computing the latitude and longitude bounds of the object with (RefLink[GeoBounds, paclet:ref/GeoBounds]), adding a small amount of padding, and finally completing the rectangular plot range, effectively using (RefLink[GeoRangePadding, paclet:ref/GeoRangePadding])->(RefLink[Full, paclet:ref/Full]).

The map of Australia:

map=GeoGraphics[(Entity["Australia", Entity["Country","Australia"], "Entity[\"Country\", \"Australia\"]", "country"])]

This is the geo range chosen by (RefLink[GeoGraphics, paclet:ref/GeoGraphics]):

AbsoluteOptions[map,GeoRange]

The latitude and longitude limits of Australia are actually smaller:

bounds=GeoBounds[(Entity["Australia", Entity["Country","Australia"], "Entity[\"Country\", \"Australia\"]", "country"])]

GeoGraphics[GeoRange->bounds,GeoRangePadding->None]

AbsoluteOptions[%,GeoRange]

To obtain the limits above, you need to extend by 5%:

GeoGraphics[GeoRange->bounds,GeoRangePadding->Scaled[0.05]]

GeoBounds[LinguisticAssistant,Scaled[0.05]]

Finally, to obtain the original map, combine the padding specification with (RefLink[Full, paclet:ref/Full]):

GeoGraphics[GeoRange->bounds,GeoRangePadding->{Scaled[0.05],Full}]

The (RefLink[GeoRangePadding, paclet:ref/GeoRangePadding]) option is very flexible. It allows you to specify independent paddings for the four different sides of the map, and also allows different ways of specifying the actual padding: distances, angles, or scaled fractions of the total map. Click the link on its name to explore all the possibilities.

GeoZoomLevel and ImageSize

Yet another way of providing a geo range is by selecting a point (for example, using (RefLink[GeoCenter, paclet:ref/GeoCenter]) or giving a point-like object in the first argument of (RefLink[GeoGraphics, paclet:ref/GeoGraphics])) and a zoom level. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will then choose a geo range radius so that the geo background image is constructed with a small number (generally around 10) tiles of 256×256 pixels. It is possible to get larger geo ranges by increasing the (RefLink[ImageSize, paclet:ref/ImageSize]) option of the map.

Zoom and image size specification.

A map around Paris at zoom level 5:

GeoGraphics[GeoCenter->(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"]),GeoZoomLevel->5]

This was the associated geo range selected:

georange=GeoRange/.AbsoluteOptions[%,GeoRange]

You can get larger images of the same area (also with correspondingly increased zooms) as follows:

GeoGraphics[GeoRange->georange,ImageSize->450]

AbsoluteOptions[%,GeoZoomLevel]

GeoGraphics[GeoRange->georange,ImageSize->900]

AbsoluteOptions[%,GeoZoomLevel]

Geo Primitives

Points and Markers

The simplest primitive to use is (RefLink[Point, paclet:ref/Point]). It will represent a point on the map, with the standard flexibility in (RefLink[Graphics, paclet:ref/Graphics]) to control its size, color, opacity, etc.

Zero-dimensional geo primitives.

Take the list of supervolcanos:

volcanos=EntityList[(EntityClass["Supervolcanos", EntityClass["Volcano","Supervolcanos"], "EntityClass[\"Volcano\", \"Supervolcanos\"]", "volcanos"])]

These are their respective positions:

positions=EntityValue[volcanos,"Position"]

Draw a point at each position:

GeoGraphics[Point/@positions,GeoRange->"World"]

Draw larger points, with a different color. Note that you can also use (RefLink[Point, paclet:ref/Point]) without mapping it over the list of positions:

GeoGraphics[{PointSize[Large],Red,Point[positions]},GeoRange->"World"]

The use of (RefLink[GeoPosition, paclet:ref/GeoPosition]) inside (RefLink[Point, paclet:ref/Point]) guarantees that the points will be properly placed in the map for any projection:

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

You can also use the list of entities directly. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) will internally use (RefLink[EntityValue, paclet:ref/EntityValue]) to get their positions:

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

You can even use the (RefLink[EntityClass, paclet:ref/EntityClass]) object itself, because it represents the list of its members:

GeoGraphics[{PointSize[Large],Red,Point[(EntityClass["Supervolcanos", EntityClass["Volcano","Supervolcanos"], "EntityClass[\"Volcano\", \"Supervolcanos\"]", "volcanos"])]},GeoRange->"World",GeoProjection->"Bonne"]

The (RefLink[GeoMarker, paclet:ref/GeoMarker]) primitive adds the flexibility of placing anything at the given position.

This is the default geo marker:

GeoGraphics[GeoMarker[(EntityClass["Supervolcanos", EntityClass["Volcano","Supervolcanos"], "EntityClass[\"Volcano\", \"Supervolcanos\"]", "volcanos"])],GeoRange->"World"]

Take this image of a volcano:

EntityValue[(Entity["volcano", Entity["Icon","Volcano"], "Entity[\"Icon\", \"Volcano\"]", "icon"]),"Image"]

Use it at each location. You could have used the image itself instead of the icon (RefLink[Entity, paclet:ref/Entity]) object:

GeoGraphics[GeoMarker[(EntityClass["Supervolcanos", EntityClass["Volcano","Supervolcanos"], "EntityClass[\"Volcano\", \"Supervolcanos\"]", "volcanos"]),(Entity["volcano", Entity["Icon","Volcano"], "Entity[\"Icon\", \"Volcano\"]", "icon"]),"Color"->Black,"Scale"->Scaled[0.1]],GeoRange->"World"]

Paths

The (RefLink[GeoPath, paclet:ref/GeoPath]) primitive represents any line on the surface of the Earth before it is projected onto the flat map. That is, a (RefLink[GeoPath, paclet:ref/GeoPath]) object is a trajectory that has geometric meaning on the curved surface of the Earth. Currently three types of such lines are supported: "Geodesic" (shortest path between any two given points), "Loxodrome" (curve that crosses all meridians with the same bearing or angle), and "GreatCircle" (curve obtained by cutting the Earth by a plane through its center). Meridians are always both loxodromes and great circles. Parallels are always loxodromes but not necessarily great circles. The equator is the only parallel that is also a great circle.

One-dimensional geo primitives.

The default type of a (RefLink[GeoPath, paclet:ref/GeoPath]) object is "Geodesic". This is a geodesic:

GeoGraphics[GeoPath[{(Entity["Madrid", Entity["City",{"Madrid","Madrid","Spain"}], "Entity[\"City\", {\"Madrid\", \"Madrid\", \"Spain\"}]", "city"]),(Entity["Moscow", Entity["City",{"Moscow","Moscow","Russia"}], "Entity[\"City\", {\"Moscow\", \"Moscow\", \"Russia\"}]", "city"])}]]

The Lambert azimuthal projection represents the geodesic as nearly straight. Compare to the equirectangular and Mercator projections for the same region:

GeoGraphics[GeoPath[{(Entity["Madrid", Entity["City",{"Madrid","Madrid","Spain"}], "Entity[\"City\", {\"Madrid\", \"Madrid\", \"Spain\"}]", "city"]),(Entity["Moscow", Entity["City",{"Moscow","Moscow","Russia"}], "Entity[\"City\", {\"Moscow\", \"Moscow\", \"Russia\"}]", "city"])}],GeoProjection->"Equirectangular"]

GeoGraphics[GeoPath[{(Entity["Madrid", Entity["City",{"Madrid","Madrid","Spain"}], "Entity[\"City\", {\"Madrid\", \"Madrid\", \"Spain\"}]", "city"]),(Entity["Moscow", Entity["City",{"Moscow","Moscow","Russia"}], "Entity[\"City\", {\"Moscow\", \"Moscow\", \"Russia\"}]", "city"])}],GeoProjection->"Mercator"]

This is the loxodrome curve, or rhumb line, from Buenos Aires to Lisbon:

GeoGraphics[GeoPath[{(Entity["Buenos Aires", Entity["City",{"BuenosAires","BuenosAires","Argentina"}], "Entity[\"City\", {\"BuenosAires\", \"BuenosAires\", \"Argentina\"}]", "city"]),(Entity["Lisbon", Entity["City",{"Lisbon","Lisboa","Portugal"}], "Entity[\"City\", {\"Lisbon\", \"Lisboa\", \"Portugal\"}]", "city"])},"RhumbLine"],GeoProjection->"Equirectangular"]

It crosses all meridians with this angle, measured on the surface of the Earth, not on the map:

GeoDirection[(Entity["Buenos Aires", Entity["City",{"BuenosAires","BuenosAires","Argentina"}], "Entity[\"City\", {\"BuenosAires\", \"BuenosAires\", \"Argentina\"}]", "city"]),(Entity["Lisbon", Entity["City",{"Lisbon","Lisboa","Portugal"}], "Entity[\"City\", {\"Lisbon\", \"Lisboa\", \"Portugal\"}]", "city"])]

Compare the three types of (RefLink[GeoPath, paclet:ref/GeoPath]) between two given points:

p=GeoPosition[{-35,-55}];
q=GeoPosition[{70,100}];

GeoGraphics[{Blue,GeoPath[{p,q},"GreatCircle"],Red,GeoPath[{p,q},"Geodesic"],Green,GeoPath[{p,q},"Loxodrome"]}]

The geodesic and the great circle are nearly identical, but not exactly, due to the Earth being ellipsoidal. Zoom in near Iceland:

GeoGraphics[{Blue,GeoPath[{p,q},"GreatCircle"],Red,GeoPath[{p,q},"Geodesic"],Green,GeoPath[{p,q},"Loxodrome"]},GeoRange->LinguisticAssistant]

It may seem strange that the red curve above is shorter than the green curve. The orthographic projection explains the difference:

GeoGraphics[{Blue,GeoPath[{p,q},"GreatCircle"],Red,GeoPath[{p,q},"Geodesic"],Green,GeoPath[{p,q},"Loxodrome"]},GeoProjection->"Orthographic",GeoCenter->{30,-35},GeoRange->"World",GeoGridLines->Automatic]

You have seen examples of geo paths between pairs of points. (RefLink[GeoPath, paclet:ref/GeoPath])[{(Subscript[p, 1]),(Subscript[p, 2]),…,(Subscript[p, n])},type] gives a continuous line formed by segments of the given type between consecutive points (Subscript[p, i]), but the complete line is not of that type in general.

Draw the shortest route between several cities. The whole line is not a geodesic between the initial and final points:

GeoGraphics[{Red,GeoPath[{(Entity["Portland", Entity["City",{"Portland","Oregon","UnitedStates"}], "Entity[\"City\", {\"Portland\", \"Oregon\", \"UnitedStates\"}]", "city"]),(Entity["Orlando", Entity["City",{"Orlando","Florida","UnitedStates"}], "Entity[\"City\", {\"Orlando\", \"Florida\", \"UnitedStates\"}]", "city"]),(Entity["Boston", Entity["City",{"Boston","Massachusetts","UnitedStates"}], "Entity[\"City\", {\"Boston\", \"Massachusetts\", \"UnitedStates\"}]", "city"])},"Geodesic"]}]

Join the final point to the initial point with an additional segment of the same type:

GeoGraphics[{Red,GeoPath[{(Entity["Portland", Entity["City",{"Portland","Oregon","UnitedStates"}], "Entity[\"City\", {\"Portland\", \"Oregon\", \"UnitedStates\"}]", "city"]),(Entity["Orlando", Entity["City",{"Orlando","Florida","UnitedStates"}], "Entity[\"City\", {\"Orlando\", \"Florida\", \"UnitedStates\"}]", "city"]),(Entity["Boston", Entity["City",{"Boston","Massachusetts","UnitedStates"}], "Entity[\"City\", {\"Boston\", \"Massachusetts\", \"UnitedStates\"}]", "city"])},"Geodesic",CurveClosed->True]}]

There are named types of geo paths, including {"Parallel",lat}, {"Meridian",lon}, and particular cases like "Equator", "PrimeMeridian", or "DateLineMeridian".

Draw several parallels:

GeoGraphics[{Red,GeoPath[{"Parallel",40}],Blue,GeoPath[{"Parallel",10}],Orange,GeoPath[{"Parallel",-40}]},GeoRange->"World"]

Draw parts of parallels, from west to east or from east to west. Use (RefLink[Arrow, paclet:ref/Arrow]) to add the arrowhead to a geo path:

GeoGraphics[{Thin,Arrow@GeoPath[{"Parallel",40,{-170,140}}],Arrow@GeoPath[{"Parallel",-30,{170,-140}}]},GeoRange->"World"]

Important named geo lines:

GeoGraphics[{Red,GeoPath["Equator"],Orange,GeoPath["NorthernTropic"],GeoPath["SouthernTropic"],Blue,GeoPath["ArcticCircle"],GeoPath["AntarcticCircle"],Green,GeoPath["GreenwichMeridian"],GeoPath["DateLineMeridian"]},GeoProjection->"WinkelTripel"]

Draw the international date line:

GeoGraphics[{Red,GeoPath["DateLine"]},GeoRange->{All,{90,270}},GeoGridLines->(QuantityUnit[15]),Frame->True]

Circles and Disks

A geo circle with center p and radius r is a closed line surrounding p whose points are all at geo distance r from p. Due to the curvature of the Earth, the total length of the geo circle will be smaller than 2π r, and in fact if r keeps growing, the geo circle will start decreasing in size and focus around the antipode of p.

Disk-like geo primitives.

A geo circle of 500 kilometers of radius around Chicago:

GeoGraphics[GeoCircle[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[500,"Kilometers"]]]

A geo circle of 5000 kilometers around the same place. It does not look circular in the equirectangular projection:

GeoGraphics[GeoCircle[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[5000,"Kilometers"]]]

If the geo circle crosses the pole, it will look like this:

GeoGraphics[GeoCircle[LinguisticAssistant,Quantity[7000,"Kilometers"]],GeoRange->"World"]

And if it gets even bigger, it will start focusing around the antipodal point:

GeoGraphics[GeoCircle[LinguisticAssistant,Quantity[17000,"Kilometers"]],GeoRange->"World"]

All together, in steps of 1000 kilometers:

GeoGraphics[Table[{Hue[r/30000],GeoCircle[LinguisticAssistant,Quantity[r,"Kilometers"]]},{r,1000,20000,1000}],GeoRange->"World"]

Due to the Earth being ellipsoidal, the last geo circle in that sequence is as follows:

GeoGraphics[{Hue[2/3],GeoCircle[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[20000,"Kilometers"]]},GeoScaleBar->"Metric"]

A geo disk is the 2D interior of a geo circle. A geo circle (like any closed curve) separates the surface of the Earth into two finite parts. The interior is the part containing the center point, not necessarily smaller in area than the exterior.

A geo disk of 500 kilometers of radius around Chicago:

GeoGraphics[GeoDisk[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[500,"Kilometers"]]]

A geo disk of 5000 kilometers around the same place:

GeoGraphics[GeoDisk[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[5000,"Kilometers"]]]

If the geo disk crosses the pole, it will look like this:

GeoGraphics[GeoDisk[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[7000,"Kilometers"]],GeoRange->"World"]

And if it gets even bigger, it will cover most of the Earth, except for a small region around the antipodal point:

GeoGraphics[GeoDisk[(Entity["Chicago", Entity["City",{"Chicago","Illinois","UnitedStates"}], "Entity[\"City\", {\"Chicago\", \"Illinois\", \"UnitedStates\"}]", "city"]),Quantity[17000,"Kilometers"]],GeoRange->"World"]

Hemispheres

A hemisphere covers exactly half of the Earth's surface, as divided by a plane passing through the Earth's center. Hence the boundary of a hemisphere is a great circle (actually a great ellipse because an ellipsoidal model of the Earth is being used). The Wolfram Language provides two types of geo primitives to work with hemispheres: on the one hand is the hemisphere (RefLink[GeoHemisphere, paclet:ref/GeoHemisphere])[p] around a point p of the surface, and on the other hand are the especially important hemispheres (RefLink[DayHemisphere, paclet:ref/DayHemisphere])[date] and (RefLink[NightHemisphere, paclet:ref/NightHemisphere])[date], determined by the position of the Sun at the given date. The boundary of (RefLink[GeoHemisphere, paclet:ref/GeoHemisphere])[p] is the line (RefLink[GeoHemisphereBoundary, paclet:ref/GeoHemisphereBoundary])[p]. The boundary of the day and night hemispheres is (RefLink[DayNightTerminator, paclet:ref/DayNightTerminator])[date].

Hemisphere-related geo primitives.

The hemisphere around Tokyo:

GeoGraphics[GeoHemisphere[(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])],GeoRange->"World"]

Superimpose its boundary line:

GeoGraphics[{GeoHemisphere[(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])],Red,GeoHemisphereBoundary[(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])]},GeoRange->"World"]

Use an azimuthal projection centered at Tokyo:

GeoGraphics[{GeoHemisphere[(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])],Red,GeoHemisphereBoundary[(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])]},GeoRange->"World",GeoProjection->{"LambertAzimuthal","Centering"->(Entity["Tokyo", Entity["City",{"Tokyo","Tokyo","Japan"}], "Entity[\"City\", {\"Tokyo\", \"Tokyo\", \"Japan\"}]", "city"])}]

The Northern Hemisphere:

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

The day and night hemispheres are just an application of (RefLink[GeoHemisphere, paclet:ref/GeoHemisphere]) for the projection of the position of the Sun on the Earth's surface, or its antipodal point. To avoid ambiguities, dates must be specified with explicit (RefLink[TimeZone, paclet:ref/TimeZone]) specifications.

The daylight and night parts of the Earth at a northern winter solstice:

GeoGraphics[NightHemisphere[(DateObject["Sun 21 Dec 2014 16:57""GMT"-6., DateObject[{2014,12,21},TimeObject[{16,57},TimeZone->-6.],TimeZone->-6.]])],GeoRange->"World"]

The daylight and night parts of the Earth at a spring equinox:

GeoGraphics[NightHemisphere[(DateObject["Fri 20 Mar 2015 17:39""GMT"-5.`, DateObject[{2015,3,20},TimeObject[{17,39},TimeZone->-5.`],TimeZone->-5.`]])],GeoRange->"World"]

Region of Visibility from a Height

A geo hemisphere can be considered the part of the Earth that would be visible from very far (actually infinite distance) along some direction. Here the generalization of that concept when the viewing point is at finite height over the surface of the ellipsoidal Earth is introduced. The region obtained is then always smaller than a hemisphere. The geometric construction is very similar though: the region of visibility is also determined by a secant plane, but now it does not pass through the center of the Earth.

Regions of visibility.

The region currently viewable from the International Space Station:

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

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

The boundary of the visible region from geostationary orbit over the point {0,0}:

GeoGraphics[GeoVisibleRegionBoundary[{0,0,(QuantityUnit[35786])}],GeoRange->"World"]

Line, Polygon, and Other Standard Graphics Primitives

The standard, non-geo graphical primitives, like (RefLink[Line, paclet:ref/Line]), (RefLink[Polygon, paclet:ref/Polygon]), (RefLink[Circle, paclet:ref/Circle]), etc. can also be used in (RefLink[GeoGraphics, paclet:ref/GeoGraphics]), but are interpreted as primitives on the flat map, not on the surface of the Earth as their geo counterparts are. They have the same standard properties they have in (RefLink[Graphics, paclet:ref/Graphics]); in particular, the segments in (RefLink[Line, paclet:ref/Line]) and (RefLink[Polygon, paclet:ref/Polygon]) between any two consecutive points are straight lines.

Take four geo positions:

p1=GeoPosition[{-60,-30}];
p2=GeoPosition[{60,-60}];
p3=GeoPosition[{60,60}];
p4=GeoPosition[{-60,30}];

The (RefLink[Line, paclet:ref/Line]) primitive connecting those four points always has straight sides, in every projection, but the (RefLink[GeoPath, paclet:ref/GeoPath]) connecting them has generically curved sides:

GeoGraphics[{Line[{p1,p2,p3,p4,p1}],Red,GeoPath[{p1,p2,p3,p4,p1}]}]

On the other hand, the points of the geodesics are uniquely defined, while the (RefLink[Line, paclet:ref/Line]) points are not. For some projections, the black line passes through Brazil, but not for others:

GeoGraphics[{Line[{p1,p2,p3,p4,p1}],Red,GeoPath[{p1,p2,p3,p4,p1}]},GeoProjection->"Albers"]

In all cases, one geodesic segment passes between Mozambique and Madagascar, but the corresponding (RefLink[Line, paclet:ref/Line]) segment crosses different countries of Africa for different projections:

GeoGraphics[{Line[{p1,p2,p3,p4,p1}],Red,GeoPath[{p1,p2,p3,p4,p1}]},GeoProjection->"LambertAzimuthal"]

It is possible to use directly projected coordinates in the standard non-geo primitives, but this requires taking into account which projection is being used. This is useful for adding additional graphical elements to the map, not directly related to elements existing on the surface of the Earth. In fact, you can use coordinates that do not even correspond to any point on the surface of the Earth. When this is done, it is highly recommended that the projection being used be made explicit in the input, to avoid (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) selecting a different projection when more primitives are added.

Add arrows and texts to a map in the "Bonne" projection. Note how (RefLink[GeoPosition, paclet:ref/GeoPosition]) specifications are mixed with projected coordinates in some (RefLink[Line, paclet:ref/Line]) primitives:

GeoGraphics[{Arrow@Line[{{-2,2},GeoPosition[{40,-100}]}],Text["North America",{-2,2.2}],Arrow@Line[{{2,-2},GeoPosition[{0,20}]}],Text["Africa",{2.5,-2}]},GeoRange->"World",GeoProjection->"Bonne",Frame->True,PlotRange->{{-4,4},{-3,3}}]

Using a different projection will automatically modify the positions specified with (RefLink[GeoGraphics, paclet:ref/GeoGraphics]), but not the positions given with projected coordinates:

GeoGraphics[{Arrow@Line[{{-2,2},GeoPosition[{40,-100}]}],Text["North America",{-2,2.2}],Arrow@Line[{{2,-2},GeoPosition[{0,20}]}],Text["Africa",{2.5,-2}]},GeoRange->"World",GeoProjection->"AmericanPolyconic",Frame->True,PlotRange->{{-4,4},{-3,3}}]

(RefLink[PlotRange, paclet:ref/PlotRange]) and (RefLink[GeoRange, paclet:ref/GeoRange]) are completely independent options. Typically (RefLink[GeoRange, paclet:ref/GeoRange]) is specified and (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) is allowed to choose an appropriate (RefLink[PlotRange, paclet:ref/PlotRange]), but you can always specify both. (RefLink[GridLines, paclet:ref/GridLines]) and (RefLink[GeoGridLines, paclet:ref/GeoGridLines]) are also independent:

GeoGraphics[GeoRange->{{0,40},{-20,40}},PlotRange->{{-0.6,0.6},{-0.5,1}},GeoProjection->"WinkelTripel",Frame->True,GeoGridLines->Automatic,GridLines->Automatic,GeoRangePadding->None]

Advanced: The Structure of a GeoGraphics Result

The output of a (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) input expression also has head (RefLink[GeoGraphics, paclet:ref/GeoGraphics]), but its first argument is now a (RefLink[Graphics, paclet:ref/Graphics]) object, the actual graphics object that is displayed as the map. This output (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) also contains a sequence of options with absolute values, both options that were given in input and options that were decided by (RefLink[GeoGraphics, paclet:ref/GeoGraphics]).

Analyze the structure of (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) in output:

g=GeoGraphics[]

The output still has head (RefLink[GeoGraphics, paclet:ref/GeoGraphics]):

Head[g]

The first argument is a (RefLink[Graphics, paclet:ref/Graphics]) object, and then there is a sequence of options:

Head[g[[1]]]

list=List@@g

In particular, there is information about the projection:

GeoProjection/.Rest[list]

The zoom level selected:

GeoZoomLevel/.Rest[list]

Or the geo range and center chosen:

GeoRange/.Rest[list]

GeoCenter/.Rest[list]

You also see the ellipsoidal model chosen for the Earth, the default "ITRF00":

GeoModel/.Rest[list]

An important option contained in the (RefLink[Graphics, paclet:ref/Graphics]) object itself is (RefLink[PlotRange, paclet:ref/PlotRange]):

Options[g,PlotRange]

To extract the images in the result (in this case just the background image), use the following:

images=Cases[g,_Image,Infinity]

ImageDimensions[images[[1]]]

Advanced: Geo Evaluation of Geo Primitives

The geo primitives are converted into standard primitives in the "Equirectangular" projection so that they can be easily displayed using (RefLink[Graphics, paclet:ref/Graphics]).

Use Geographics`GeoEvaluate on a (RefLink[GeoCircle, paclet:ref/GeoCircle]), converting it into a (RefLink[Line, paclet:ref/Line]) object containing a list of {lon,lat} pairs:

Short[line=GeoGraphics`GeoEvaluate[GeoCircle[{60,0},Quantity[1000,"Kilometers"]]],3]

Graphics[{Red,line,Blue,PointSize[Small],Point@@line},Frame->True]

A second argument of GeoGraphics`GeoEvaluate specifies the model of the spheroid being used, either a number in meters or a (RefLink[Quantity, paclet:ref/Quantity]) distance representing a sphere of that radius, or a pair {a,b} of semiaxes of an ellipsoid of revolution, also given as numbers in meters or (RefLink[Quantity, paclet:ref/Quantity]) lengths. The result is now different.

The same geo circle but now on a sphere of 2000 kilometers of radius. The result is different:

Short[line=GeoGraphics`GeoEvaluate[GeoCircle[{60,0},Quantity[1000,"Kilometers"]],Quantity[2000,"Kilometers"]],3]

Graphics[{Red,line,Blue,PointSize[Small],Point@@line},Frame->True]

A third argument of GeoGraphics`GeoEvaluate specifies the resolution distance required, in meters. When this number is smaller, then the geo primitives are resolved with more points, to guarantee that neighbors are closer than that distance.

Use a resolution of only 1000 meters. The same geo circle is now resolved with many more points:

Short[line=GeoGraphics`GeoEvaluate[GeoCircle[{60,0},Quantity[1000,"Kilometers"]],Quantity[2000,"Kilometers"],1000],3]

Graphics[{Red,line,Blue,PointSize[Small],Point@@line},Frame->True]

Geo Styling

Map Stylings

(RefLink[GeoGraphics, paclet:ref/GeoGraphics]) inherits from (RefLink[Graphics, paclet:ref/Graphics]) a large variety of directives that can be used to stylize a map, including colors, opacities, textures, and many more. It also adds new elements that are characteristic of maps, which automatically respond to the projection being used. The most important new element is (RefLink[GeoStyling, paclet:ref/GeoStyling])[mapstyle,directive], which specifies how to stylize an arbitrary area of the map; that could be in particular the geo background.

(RefLink[GeoGraphics, paclet:ref/GeoGraphics]) provides several predefined map styles, like "StreetMap", "ReliefMap", or "ContourMap", and only allows you to place arbitrary images on a polygon.

Map styling.

The default style map is "StreetMap":

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"])]

Show the same area, but without labels:

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"]),GeoBackground->GeoStyling["StreetMapNoLabels"]]

Show a relief map of elevations:

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"]),GeoBackground->GeoStyling["ReliefMap"]]

Or the corresponding contour map. Use options to control the result:

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"]),GeoBackground->GeoStyling["ContourMap",Contours->20]]

Show a satellite image:

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"]),GeoBackground->GeoStyling["Satellite"]]

Show an outline map with country borders:

GeoGraphics[(Entity["Morocco", Entity["Country","Morocco"], "Entity[\"Country\", \"Morocco\"]", "country"]),GeoBackground->GeoStyling["CountryBorders"]]

(RefLink[GeoStyling, paclet:ref/GeoStyling]) effectively works like (RefLink[Texture, paclet:ref/Texture]), specifying what to place inside the following 2D primitives, like geo disks or polygons. In that sense, the (RefLink[GeoBackground, paclet:ref/GeoBackground]) option can be considered as the particular case of specifying what to place in the whole map.

A relief map of Peru over a map with default style:

GeoGraphics[{GeoStyling["ReliefMap"],Polygon[(Entity["Peru", Entity["Country","Peru"], "Entity[\"Country\", \"Peru\"]", "country"])]}]

(RefLink[GeoStyling, paclet:ref/GeoStyling]) can be used to show a map confined to the borders of a given area:

GeoGraphics[{GeoStyling["StreetMap"],GeoDisk[(Entity["Paris", Entity["City",{"Paris","IleDeFrance","France"}], "Entity[\"City\", {\"Paris\", \"IleDeFrance\", \"France\"}]", "city"]),Quantity[500,"Kilometers"]]},GeoBackground->None]

GeoGraphics[{GeoStyling["ReliefMap"],Polygon[(Entity["Italy", Entity["Country","Italy"], "Entity[\"Country\", \"Italy\"]", "country"])]},GeoBackground->None]

There are two flexible map styles that allow you to place arbitrary images and graphics on a map, namely {"Image",image} and {"GeoImage",image}. The difference is that in the first case the image will be placed in the given area with no transformation (perhaps only a change in aspect ratio), while in the latter case the image will be projected along the map area. Therefore "GeoImage" is adapted to place pieces of maps over other maps.

Take a picture of Gauss:

gauss=EntityValue[(Entity["Carl Friedrich Gauss", Entity["Person","CarlFriedrichGauss::4vctc"], "Entity[\"Person\", \"CarlFriedrichGauss::4vctc\"]", "person"]),"Image"]

Place it over Germany, in the default "Mercator" projection:

GeoGraphics[{GeoStyling[{"Image",gauss}],Polygon[(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"])]}]

With the (StringTypeLink["Image", paclet:ref/interpreter/Image]) map style, the image will preserve its orientation in any projection:

GeoGraphics[{GeoStyling[{"Image",gauss}],Polygon[(Entity["Germany", Entity["Country","Germany"], "Entity[\"Country\", \"Germany\"]", "country"])]},GeoProjection->{"Bonne","Centering"->60},GeoRange->Quantity[500,"Miles"],GeoGridLines->Automatic]

Take this nice old map of Brazil and cut its borders:

brazil=ImageTake[ImageResize[Import["http://upload.wikimedia.org/wikipedia/commons/e/eb/1855_Colton_Map_of_Brazil_and_Guyana_-_Geographicus_-_Brazil-colton-1855.jpg"],{500}],{75,460},{5,388}]

Using the "GeoImage" map style, it will be projected appropriately in any map:

GeoGraphics[{GeoStyling[{"GeoImage",brazil}],Polygon[LinguisticAssistant]},GeoProjection->{"Orthographic","Centering"->{-50,-30}},GeoRange->"World",GeoGridLines->Automatic]

Opacity and Color

The (RefLink[Graphics, paclet:ref/Graphics]) 2D primitives are opaque by default because the background is typically empty, so it can be covered. However, (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) usually contains a map image as geo background, which should not be fully covered by the primitives over it. Therefore, the default opacity of 2D primitives is small: 0.2. This throws in a slight twist in how opacities are handled in (RefLink[GeoGraphics, paclet:ref/GeoGraphics]), because the opacities of the 2D primitives need to be distinguished from the opacities of the rest of the primitives (points and lines), which are still opaque by default. This can be done by using (RefLink[GeoStyling, paclet:ref/GeoStyling]) again.

A geo disk around Ottawa, with a thick blue border. The geo circle is opaque, but the disk is not:

GeoGraphics[{GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Blue,Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

Standard opacity specifications will affect all primitives except for the 2D primitives:

GeoGraphics[{Opacity[0.5],GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Blue,Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

To change the opacity of the disk, use (RefLink[GeoStyling, paclet:ref/GeoStyling])[opacity], which will not affect the thick geo circle:

GeoGraphics[{GeoStyling[Opacity[0.5]],GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Blue,Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

Colors will affect all primitives normally:

GeoGraphics[{GeoStyling[Opacity[0.5]],Blue,GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

But colors placed inside (RefLink[GeoStyling, paclet:ref/GeoStyling]) take precedence for 2D primitives, even over colors that are given afterward:

GeoGraphics[{GeoStyling[Opacity[0.5],Red],Blue,GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

(RefLink[GeoStyling, paclet:ref/GeoStyling])[(RefLink[Automatic, paclet:ref/Automatic])] undoes the action of any previous (RefLink[GeoStyling, paclet:ref/GeoStyling]) specification and recovers the defaults:

GeoGraphics[{GeoStyling[Opacity[0.5],Red],Blue,GeoStyling[Automatic],GeoDisk[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]],Thickness[0.05],GeoCircle[(Entity["Ottawa", Entity["City",{"Ottawa","Ontario","Canada"}], "Entity[\"City\", {\"Ottawa\", \"Ontario\", \"Canada\"}]", "city"]),Quantity[400,"Kilometers"]]}]

Geo Grid Lines and Scale Bar

Drawing parallels and meridians is always very useful for understanding the orientation of the elements on a map, even more so when using a noncylindrical projection. The option (RefLink[GeoGridLines, paclet:ref/GeoGridLines]) and its styling counterpart (RefLink[GeoGridLinesStyle, paclet:ref/GeoGridLinesStyle]) provide a flexible interface to drawing the so-called graticule of lines.

Other map styling options.

In the "Equirectangular" projection, the parallels and meridians are straight lines (as in all cylindrical projections) and are equally spaced. Let the system choose the lines:

GeoGraphics[GeoRange->"World",GeoGridLines->Automatic]

These are the latitude and longitude lines used, multiples of "nice" integer angles:

AbsoluteOptions[%,GeoGridLines]

Specify respective approximate numbers of lines to use, in any projection:

GeoGraphics[GeoRange->"World",GeoGridLines->{8,30},GeoProjection->"Albers"]

Specify the graticule subdivision size as (RefLink[Quantity, paclet:ref/Quantity]) angles:

GeoGraphics[{Green,GeoPath["PrimeMeridian"],Red,GeoPath["Equator"]},GeoRange->"World",GeoGridLines->Quantity[5,"AngularDegrees"],GeoProjection->{"Orthographic","Centering"->GeoPosition[{40,30}]}]

To read scale in a map, you can use the (RefLink[GeoScaleBar, paclet:ref/GeoScaleBar]) option. For large-scale maps, the distance scale factor may vary from point to point, and therefore the scale bar will only represent an average.

Use a scale bar with metric units in a map of France:

GeoGraphics[(Entity["France", Entity["Country","France"], "Entity[\"Country\", \"France\"]", "country"]),GeoScaleBar->"Metric"]

Other Celestial Bodies

All of the above has been presented for the Earth, but can be applied to other celestial bodies for which satellite images exist, like Mars, Pluto, or the Moon. (RefLink[GeoGraphics, paclet:ref/GeoGraphics]) uses appropriate background tiles as determined by the value of the option (RefLink[GeoModel, paclet:ref/GeoModel]).

Geo model specification.

A map of the Moon in the Mollweide projection:

GeoGraphics[GeoModel->(Entity["Moon", Entity["PlanetaryMoon","Moon"], "Entity[\"PlanetaryMoon\", \"Moon\"]", "planetary moon"]),GeoRange->All,GeoProjection->"Mollweide",GeoGridLines->Automatic,GeoGridLinesStyle->Directive[Thin,White,Opacity[0.5]],Background->Black]

A shallow valley on the Moon:

GeoGraphics[GeoCenter->(Entity["Rima Ariadaeus", Entity["SolarSystemFeature","RimaAriadaeusMoon"], "Entity[\"SolarSystemFeature\", \"RimaAriadaeusMoon\"]", "solar system feature"]),GeoRange->(Quantity[50, "mi", miles, "Miles"])]

The Copernicus crater:

GeoGraphics[GeoCenter->(Entity["Copernicus", Entity["SolarSystemFeature","CopernicusMoon"], "Entity[\"SolarSystemFeature\", \"CopernicusMoon\"]", "solar system feature"]),GeoRange->(Quantity[50, "mi", miles, "Miles"])]

A map of Mars in the Bonne projection:

GeoGraphics[GeoModel->(Entity["Mars", Entity["Planet","Mars"], "Entity[\"Planet\", \"Mars\"]", "planet"]),GeoRange->All,GeoProjection->"Bonne",GeoGridLines->Automatic,GeoGridLinesStyle->Directive[Thin,Orange,Opacity[0.5]],Background->Black]

Show the landing position of a space probe:

GeoGraphics[GeoMarker[(Entity["Mars Science Laboratory", Entity["DeepSpaceProbe","MarsScienceLaboratory"], "Entity[\"DeepSpaceProbe\", \"MarsScienceLaboratory\"]", "deep space probe"])],GeoCenter->(Entity["Gale", Entity["SolarSystemFeature","GaleMars"], "Entity[\"SolarSystemFeature\", \"GaleMars\"]", "solar system feature"]),GeoRange->(Quantity[100, "km", kilometers, "Kilometers"])]

Another interesting area on Mars:

GeoGraphics[GeoCenter->(Entity["Noctis Labyrinthus", Entity["SolarSystemFeature","NoctisLabyrinthusMars"], "Entity[\"SolarSystemFeature\", \"NoctisLabyrinthusMars\"]", "solar system feature"]),GeoRange->(Quantity[150, "mi", miles, "Miles"])]

A view of Pluto using the orthographic projection:

GeoGraphics[GeoModel->"Pluto",GeoProjection->"Orthographic",GeoRange->All,GeoCenter->{40,180},Background->Black,PlotRangePadding->0.1,GeoZoomLevel->2]