2014-12-07 103 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

相關問題