1

Recently, I wanted to create a map showing the flags of the countries. From the documentation, I found and used the following:

flags = EntityValue["Africa", , {"Entity", "Flag"}];

GeoGraphics[{EdgeForm[
   Black], {GeoStyling[{"Image", #2}], 
     Tooltip[Polygon[#1], CommonName[#1]]} & @@@ flags}, 
 GeoBackground -> "StreetMapNoLabels"]

Then I found :

# Show the disembodied shapes of countries in South America:
Row[Show[CountryData[#, "Shape"], ImageSize -> {50, 50}] & /@ CountryData["SouthAmerica"]]

Now, I am trying to add the flags and maybe the countries names as captions.

The result should look like this: enter image description here

IordanouGiannis
  • 205
  • 1
  • 4

1 Answers1

2

Code:

   With[{vc = 
         Transpose[
          Rescale /@ Transpose[First[CountryData[#, "Coordinates"]]]]}, 
       Show[CountryData[#, "Shape"], 
         ImageSize -> {{100}, {100}}] /. {RGBColor[__] :> 
          Texture[ImageReflect[Image[CountryData[#, "Flag"]], 
            Top -> Right]], 
         Polygon[a_] :> 
          Polygon[First[a], VertexTextureCoordinates -> vc]}] & /@ 
     CountryData["SouthAmerica"]

Reference:

Texture

Mathematica graphics

rhermans
  • 36,518
  • 4
  • 57
  • 149
e.doroskevic
  • 5,959
  • 1
  • 13
  • 32