10

I'm attempting to insert the county names on a map of Florida:

 counties = 
  Join @@ EntityValue[{Entity[
      "AdministrativeDivision", {"Florida", "UnitedStates"}]}, 
    EntityProperty["AdministrativeDivision", "Subdivisions"]];

 countynames = EntityValue[counties, "CanonicalName"];

countyshortnames = Table[StringDrop[StringDrop[ToString[countynames[[i]]],-30], 1], {i, 1, Length[counties]}];

loc = EntityValue[counties, "Position"];

GeoGraphics[{EdgeForm[{Thick, Black}], GeoStyling["OutlineMap"],Polygon /@ counties, Table[GeoMarker[loc[[j]],Style[countyshortnames[[j]], TextAlignment -> Center, Black, FontSize -> 10, Bold]], {j, 1,Length@countyshortnames}]},GeoBackground -> None, ImageSize -> 1200]

Mathematica graphics

The problem is that the labels turn out very unruly and I would appreciate if anyone can give me some other approach to do this task. Thank you!

C. E.
  • 70,533
  • 6
  • 140
  • 264

1 Answers1

11

Update:

The use of Geomarker to insert (text) labels is probably not correct as the documentation indicates that the marker type should be a Graphics or Image.

According to @C.E. comment in a related post, instead of using Geomarker to insert labels, it is possible to use directly the Textprimitive. In your case :

GeoGraphics[{EdgeForm[{Thick,Black}],GeoStyling["OutlineMap"],Polygon/@counties,
Table[Text[Style[countyshortnames[[j]],TextAlignment->Center,Black,FontSize->10,Bold],loc[[j]]],
{j,1,Length@countyshortnames}]},GeoBackground->None,ImageSize->1200]

enter image description here

Previous:

The problem seems to be the default "Scale" of the GeoMarker primitive. Setting for example the option "Scale"->1 for all your geomarkers seems to work. That means :

GeoGraphics[{EdgeForm[{Thick, Black}], GeoStyling["OutlineMap"],Polygon /@ counties, 
Table[GeoMarker[loc[[j]],Style[countyshortnames[[j]], TextAlignment -> Center, Black, FontSize -> 10, Bold], 
"Scale"->1], {j, 1,Length@countyshortnames}]},GeoBackground -> None, ImageSize -> 1200]
SquareOne
  • 7,575
  • 1
  • 15
  • 34