0

i want to add label text on map 3D based on shape the map.

the output the output

my expect my expect

i use this code

nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
pts <- st_cast(st_centroid(nc),"POINT")
st_write(pts,"Centroid/nc.csv",layer_options="GEOMETRY=AS_XY")
point <- read.csv("Centroid/nc.csv")

gg_nc = ggplot(nc) +
  geom_sf(aes(fill = AREA)) +
  geom_text(aes(x=point$X,y=point$Y,label=NAME),size=2, color='white')+
  ggtitle("Area of counties in North Carolina") +
  theme_bw()

plot_gg(gg_nc, multicore = TRUE, width = 6 ,height=2.7, fov = 70)

Please ignore the coloring, thank you..

Eriza
  • 25
  • 4
  • I honestly don't think 3d "elevated" text can be rendered at the moment with any package (at least within the ggplot-verse), you would need a completely new text rendering device. – tjebo Mar 09 '23 at 09:02
  • if it is "just" to create curved texts (in 2D!!), then you might have success with the geomtextpath package. – tjebo Mar 09 '23 at 09:04
  • to be honest I believe that finetuning of text labels is one of the areas where traditional GIS systems still have the edge (although {geomtextpath} shows promise!) – Jindra Lacko Mar 09 '23 at 12:52

0 Answers0