[R-sig-Geo] Plot street "Name" for city streets (lines) in a SpatialLinesDataFrame

Jim Burke javajimburke at gmail.com
Wed Sep 9 17:55:32 CEST 2015


Given a SpatialLinesDataFrame like below. How might I print the street
"Name" adjacent to these many streets in the SpatialLinesDataFrame? Just
what in the line class can I attach its "Name" to? I want to add this plot
as a layer to my other plots.

And I cannot post an code snippet example because I don't get that far
here. This is more basic. I want some thoughts on how to plot a tiny street
name near each street in the SpatialLinesDataFrame.

> str(DC_Roads1_sp)
Formal class 'SpatialLinesDataFrame' [package "sp"] with 4 slots
  ..@ data       :'data.frame': 125059 obs. of  31 variables:
  .. ..$ DC_ID    : num [1:125059] 843772 843773 844139 844140 844141 ...
  .. ..$ Prefix   : chr [1:125059] NA NA NA "N" ...
  .. ..$ Pretype  : chr [1:125059] NA NA "STHY" NA ...
  .. ..$ Name     : chr [1:125059] "Freeport" "Freeport" "183" "Valley
View" ...

Then the line class looks like below (first two are shown)

 ..@ lines      :List of 125059
  .. ..$ :Formal class 'Lines' [package "sp"] with 2 slots
  .. .. .. ..@ Lines:List of 1
  .. .. .. .. ..$ :Formal class 'Line' [package "sp"] with 1 slot
  .. .. .. .. .. .. ..@ coords: num [1:2, 1:2] -97 -97 32.9 32.9
  .. .. .. ..@ ID   : chr "0"
  .. ..$ :Formal class 'Lines' [package "sp"] with 2 slots
  .. .. .. ..@ Lines:List of 1
  .. .. .. .. ..$ :Formal class 'Line' [package "sp"] with 1 slot
  .. .. .. .. .. .. ..@ coords: num [1:2, 1:2] -97 -97 32.9 32.9
  .. .. .. ..@ ID   : chr "1"


Any and all advice/suggestions/hints/examples is appreciated.

Thanks,
Jim Burke

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list