2014-12-07 99 views
1

我想用点属性(在这种情况下,站名称和站号)标记Voronoi多边形。为了创建Voronoi多边形,我使用了this topic中的函数。我如何标签蒂森(Voronoi)多边形

我的工作站数据文件(shapefile)在here

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

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

回答

1

,你可以用textcoordinates,例如:

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

enter image description here

+0

如何添加属性(站号和名称标签)thiessen.pol属性表? – Nahm 2014-12-09 00:53:46

+0

@纳姆 - 你可以尝试'[email protected] < - pts @ data'。 – jbaums 2014-12-09 10:43:56

+0

这很好。谢谢 – Nahm 2014-12-09 19:23:50

相关问题