Skip to main content
Tweeted twitter.com/StackMma/status/905827734441615364
edited title
Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

How can I use multiple overlaid map layers from different tile servers(e.g. basemap, labels) in GeoGraphics?

added 155 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

We can use GeoServer to use map tiles from an external service. There are many compatible services:

These services often provide unlabelled background maps, as well as various layers to superimpose on a base map (e.g. labels only, borders only, etc.).

How can we use multiple layers, possibly loaded from multiple different servers, in a way that integrates well with the GeoGraphics functionality and also work with DynamicGeoGraphics?


For example, using the definitions from the above linked answer,

base = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> stamen["watercolor"]]

Mathematica graphics

labels = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> carto["light_only_labels"]]

Mathematica graphics

We could layer these together manually using one of multiple possible ways, e.g.

Overlay[{base, labels}]

Mathematica graphics

But this is not a good solution because it requires multiple GeoGraphics calls that are independent, and does not work with functions like DynamicGeoGraphics.

We can use GeoServer to use map tiles from an external service. There are many compatible services:

How can we use multiple layers, possibly loaded from multiple different servers, in a way that integrates well with the GeoGraphics functionality and also work with DynamicGeoGraphics?


For example, using the definitions from the above linked answer,

base = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> stamen["watercolor"]]

Mathematica graphics

labels = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> carto["light_only_labels"]]

Mathematica graphics

We could layer these together manually using one of multiple possible ways, e.g.

Overlay[{base, labels}]

Mathematica graphics

But this is not a good solution because it requires multiple GeoGraphics calls that are independent, and does not work with functions like DynamicGeoGraphics.

We can use GeoServer to use map tiles from an external service. There are many compatible services:

These services often provide unlabelled background maps, as well as various layers to superimpose on a base map (e.g. labels only, borders only, etc.).

How can we use multiple layers, possibly loaded from multiple different servers, in a way that integrates well with the GeoGraphics functionality and also work with DynamicGeoGraphics?


For example, using the definitions from the above linked answer,

base = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> stamen["watercolor"]]

Mathematica graphics

labels = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> carto["light_only_labels"]]

Mathematica graphics

We could layer these together manually using one of multiple possible ways, e.g.

Overlay[{base, labels}]

Mathematica graphics

But this is not a good solution because it requires multiple GeoGraphics calls that are independent, and does not work with functions like DynamicGeoGraphics.

Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

How can I use multiple map layers from different tile servers?

We can use GeoServer to use map tiles from an external service. There are many compatible services:

How can we use multiple layers, possibly loaded from multiple different servers, in a way that integrates well with the GeoGraphics functionality and also work with DynamicGeoGraphics?


For example, using the definitions from the above linked answer,

base = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> stamen["watercolor"]]

Mathematica graphics

labels = GeoGraphics[{Entity["Country", "Hungary"]}, 
  GeoServer -> carto["light_only_labels"]]

Mathematica graphics

We could layer these together manually using one of multiple possible ways, e.g.

Overlay[{base, labels}]

Mathematica graphics

But this is not a good solution because it requires multiple GeoGraphics calls that are independent, and does not work with functions like DynamicGeoGraphics.