I'd like to make a world map with a blue coloured ocean and transparent land surface (to be used later as an overlay). With:

map = GeoGraphics[
  CountryData["World", {"SchematicPolygon", "Equirectangular"}], 
  GeoRange -> {{-90, 90}, {-180, 180}}, GeoBackground -> Transparent]

I get the opposite, i.e. ocean is transparent and land is coloured. How can this be reversed?


2 Answers 2


Something like this?

polygon = CountryData["World", "SchematicPolygon"];
image = ExampleData[{"TestImage", "Lena"}];
GeoGraphics[{GeoStyling[{"GeoImage", image}], polygon}, GeoBackground -> LightBlue, GeoRange -> "World", GeoProjection -> "Bonne"]

enter image description here


Better if both images have the same dimensions. Anyway.

p = CountryData["World", "Polygon"];
rose = Import["ExampleData/rose.gif"];
mask = Graphics[{EdgeForm[Black], p}];
blueOcean = ColorReplace[mask, White -> Blue];
ImageAdd[ImageMultiply[rose, ColorNegate@mask], blueOcean]

Mathematica graphics

  • $\begingroup$ Thanks! This works; however the resulting mask and final graphic is no longer a GeoGraphics object. I'd like to keep it that way because I'd like to subsequently also project the graphic using one of the projection transformations of Mathematica 10. $\endgroup$
    – hippo3773
    Apr 8, 2015 at 20:37
  • $\begingroup$ Sorry, only version 9 here... $\endgroup$ Apr 9, 2015 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.