Using the GeoServer
option, it is possible to load map tiles from external services.
Which services are compatible with GeoServer
? How can I find such services? Does GeoServer
follow a standard that has a name that I can google for?
The documentation shows a few examples:
GeoGraphics[{Entity["AdministrativeDivision", {"California", "UnitedStates"}]},
GeoServer -> "http://a.tile.openstreetmap.org/`1`/`2`/`3`.png"
]
Answer
The keywords to search for are "tile server" and "XYZ URL". I was able to find several services compatible with this format.
There is a list, complete with previews here:
(Found through GIS.SE)
The {x}
, {y}
and {z}
placeholders in the URL correspond to `1`
, `2`
and `3`
in Mathematica.
MapBox is another great source for base maps, as shown by @C.E. in his answer.
Here are a few examples that do not require API keys:
From https://basemap.nationalmap.gov/,
USGS[map :"HydroCached" | "ImageryOnly" | "ImageryTopo" |"ShadedReliefOnly" | "Topo"] :=
"https://basemap.nationalmap.gov/arcgis/rest/services/USGS" <> map <> "/MapServer/tile/`1`/`3`/`2`"
From https://carto.com/location-data-services/basemaps/,
carto[style : "light_all" | "dark_all" | "light_nolabels" | "light_only_labels" |"dark_nolabels" | "dark_only_labels"] :=
"https://cartodb-basemaps-1.global.ssl.fastly.net/" <> style <> "/`1`/`2`/`3`.png"
From http://maps.stamen.com/,
stamenBase[style_, format_] := "http://tile.stamen.com/" <> style <> "/`1`/`2`/`3`." <> format
stamen[style : "toner"] := stamenBase[style, "png"]
stamen[style : "watercolor" | "terrain"] := stamenBase[style, "jpg"]
Demo:
GeoGraphics[Entity["AdministrativeDivision", {"California", "UnitedStates"}],
GeoServer -> #] & /@ {USGS["Topo"], carto["light_all"], stamen["terrain"]}
These are just quick and dirty examples. In some cases it may be beneficial or necessary to set the "Tileset"
suboption of GeoServer
(see under Details in doc page).
Tile servers can also be used with the interactive DynamicGeoGraphics
:
DynamicGeoGraphics[Entity["City", {"Lyon", "RhoneAlpes", "France"}],
GeoServer -> stamen["toner"]]
Comments
Post a Comment