Nahm
Nahm

Reputation: 143

How can I label Thiessen (Voronoi) polygons

I would like to label Voronoi polygons with point attributes (in this case, station name and station number). To create Voronoi polygons, I used the function from this topic.

My station data file (shapefile) is in here.

pts <- readOGR(dsn = ".", layer="rainfallStations")

thiessen.pol <- voronoipolygons(pts)
proj <- CRS('+proj=longlat +ellps=WGS84')
proj4string(thiessen.pol) <- proj

Upvotes: 1

Views: 342

Answers (1)

jbaums
jbaums

Reputation: 27388

You could text with coordinates, e.g.:

plot(thiessen.pol)
text(coordinates(thiessen.pol), labels=pts$STA_NUMBER, cex=0.9)

enter image description here

Upvotes: 1

Related Questions