GeoGridLines behind Continents in GeoGraphics Plot?
Probably not the best way, but one way is to make the gridlines and "map" parts in two separate GeoGraphics
and combine them with Show
:
lines = GeoGraphics[
{},
GeoRange -> "World",
GeoProjection -> {"Bonne", {"Centering" -> {0, 0},
"ReferenceModel" -> 1, "StandardParallels" -> {85}}},
GeoGridLines -> Automatic,
GeoGridLinesStyle -> Directive[Thin, Red],
GeoBackground -> None
]
countries = CountryData["Countries", "Name"]; (*master list of countries*)
highlighted = {"China", "Algeria"}; (*list of countries to be highlighted*)
coloring[country_] :=
Lighter[Red, If[MemberQ[highlighted, country], 0.4, 0.8]]; (*how to color them*)
countrymap = GeoGraphics[
{
{GeoStyling[FaceForm[coloring[#]], EdgeForm[White]],
CountryData[#, "SchematicPolygon"]} & /@ countries
},
GeoRange -> "World",
GeoProjection -> {"Bonne", {"Centering" -> {0, 0},
"ReferenceModel" -> 1, "StandardParallels" -> {85}}},
GeoBackground -> None
]
Putting them together:
Show[
Graphics @@ lines,
Graphics @@ countrymap,
ImageSize -> {500, Automatic} (*Just to make it a bit bigger for my own eyes*)
]
Not an expert at this, so please feel free to correct any mistakes/bad practices/etc. Anyway, hopefully this is (at least somewhat) helpful!
What about something like this? I think that if the countries have to be semi-transparent, so that some of them are highlighted, then that semi-transparency will let the geo grid lines be visible...
GeoGraphics[{GeoStyling[Red, Opacity[0.5], EdgeForm[White]], CountryData["Countries", "SchematicPolygon"], GeoStyling[Red], Polygon[Entity["Country", "Canada"]], Polygon[Entity["Country", "France"]]}, GeoRange -> "World", GeoProjection -> {"Bonne", {"Centering" -> {0, 0}, "ReferenceModel" -> 1, "StandardParallels" -> {85}}}, GeoGridLines -> Automatic, GeoGridLinesStyle -> Directive[Opacity[0.15], Red], GeoBackground -> None]