add labels from @data in SpatialLinesDataFrame in sp.polygons

المشرف العام

Administrator
طاقم الإدارة
I have the below r code which first plots a gridded heatmap then adds a layer of ploygons under that map. The roads_84 is a SpatialLinesDataFrame whos @data contains a STREET_NAM vector. I would like draw those street names onto the map, but can't figure out how.

(seems like it should be part of sp.polygons or an sp.text call, but looking throught the docs I can't seem to find anything...)

spplot(grid_df, "pop", col.regions = pop_color(256), colorkey=FALSE, panel = function(...) { panel.gridplot(..., border="gray87") sp.polygons(roads_84, col="gray48", alpha= .5) })

أكثر...
 
أعلى