[R-sig-Geo] Intersect & Plot a Polygon and wkbLineString

Jim Burke j.burke at earthlink.net
Tue Feb 17 06:13:18 CET 2009


I have a nice solid SpatialPologonsDataFrame and a new line file 
(wkbLineString) called "major roads.shp".

MY QUESTIONS.

*I would appreciate examples of*

*a)How to merge the intersection of a **SpatialPologonsDataFrame and a 
wkbLineString **

b)How to plot the result 

c)How to display the street name on the plot (that's FNAME from the 
major roads.dbf file).
*


ADDITIONAL INFORMATION.

The SpatialPologonsDataFrame is a garden variety collection of 
geographical polygons. 

 > tx1_sp <- readShapePoly("precinct08.shp", IDvar="PCT", 
proj4string=CRS("+proj=aea +ellps=GRS80 +datum=WGS84"))



The new file to intersect merge is major roads line map that should 
overlay part of my SpatialPolygons. It does not behave like a Shapfile.

 >main_roads <-readOGR("main roads.shp", layer = "main roads")
OGR data source with driver: ESRI Shapefile
Source: "main roads.shp", layer: "main roads"
with  29161  rows and  33  columns
Feature type: wkbLineString with 2 dimensions


Thanks,
Jim Burke



More information about the R-sig-Geo mailing list