Function Repository Resource:

GeoGraphicsRestyle

Source Notebook

Choose styles for specific elements of GeoGraphics

Contributed by: Jon McLoone

ResourceFunction["GeoGraphicsRestyle"][gr,typestyle]

restyles GeoGraphics gr so that elements with the annotation type are styled with style.

ResourceFunction["GeoGraphicsRestyle"][gr, {type1 style1, type2style2,]

restyles multiple elements of GeoGraphics gr.

Details

Annotation types are specified as a list of three strings. Possible values can be found using ResourceFunction["GeoGraphicsCases"].

Examples

Basic Examples (3) 

Restyle a map of the Colosseum with buildings colored red:

In[1]:=
gr = GeoGraphics[Entity["Building", "Colosseum::pq39x"], GeoRange -> Quantity[500, "Feet"]];
ResourceFunction["GeoGraphicsRestyle"][gr,
 {"fill", "building", "building"} -> Red
 ]
Out[2]=

Restyle both the buildings and the grass:

In[3]:=
ResourceFunction["GeoGraphicsRestyle"][gr,
 {
  {"fill", "building", "building"} -> DarkYellow,
  {"fill", "landcover_grass_wood", "landcover"} -> DarkGreen
  }
 ]
Out[3]=

Use ResourceFunction["GeoGraphicsCases"] to discover the available list of annotation types:

In[4]:=
ResourceFunction["GeoGraphicsCases"][gr]
Out[4]=

Scope (2) 

You can specify collections of graphics styles:

In[5]:=
gr = GeoGraphics[Entity["Building", "Colosseum::pq39x"], GeoRange -> Quantity[500, "Feet"]];
ResourceFunction["GeoGraphicsRestyle"][gr,
 {"fill", "building", "building"} -> {EdgeForm[{Thick, Dashed, Yellow}],
    Black}
 ]
Out[6]=

Textures can be used for polygon elements:

In[7]:=
ResourceFunction["GeoGraphicsRestyle"][gr,
 {
  {"fill", "building", "building"} -> Texture[ExampleData[{"ColorTexture", "YellowMarble"}]],
  {"fill", "landcover_grass_wood", "landcover"} -> Texture[ImageRecolor[ExampleData[{"Texture", "Grass"}], White -> Green]]
  }
 ]
Out[7]=

Possible Issues (1) 

GeoGraphicsRestyle does not support bitmap GeoBackround types:

In[8]:=
gr = GeoGraphics[Entity["Building", "Colosseum::pq39x"], GeoRange -> Quantity[500, "Feet"], GeoBackground -> "Satellite"];
ResourceFunction["GeoGraphicsRestyle"][gr,
 {"fill", "building", "building"} -> Red
 ]
Out[9]=

Neat Examples (1) 

Highlight the cycle routes in Central Park:

In[10]:=
gr = GeoGraphics[=[Central Park, NY], GeoRange -> Quantity[0.4, "Miles"]];
Legended[ResourceFunction["GeoGraphicsRestyle"][gr,
  {
   {"line", "path_cycleway", "transportation"} -> Yellow,
   {"line", "path_cycleway_bridge", "transportation"} -> Yellow, {"line", "path_cycleway_bridge_casing", "transportation"} -> Yellow, {"line", "path_cycleway_casing", "transportation"} -> Yellow
   }], SwatchLegend[{Yellow}, {"Cycle routes"}]]
Out[11]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 27 August 2025

Related Resources

License Information