Skip to content

Combining shp-Files and csv-Data

3 messages · Roman Luštrik, kamallauber

#
Hey people,

first of all:I am Using R 2.15.3. 
I have 2 shapefiles (.shp+.dfb+...) and a csv-table. 
Now, one shape(1) is the border of germany and the other is a grid-like
shapefile (2) (not a grid but many little cubes (1x1km). Now I want to have
a grid-like shapefile but only in the boundaries of the first shapefile.
Both of them are spatialpolygondataframes.

The next step would then be, to get the values from the csv-table to the in
the attribute table of the shapefile. The csv has a certain column
'cellnumber' which corresponds to a column in the grid-like shapefile (2). 

I know that this can easily be done with other gis software such as arcgis
but i need to do it with R.
Any help would be much appreciated.

Greets, Matthias



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Combining-shp-Files-and-csv-Data-tp7583245.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
#
First of all thank you for the quick response.

I did read the shapefiles with readOGR and i understand how you would do
that with rgeos, but i have a single shapefile which consists of all these
little "cubes" and i do not understand in which way i can extract some of
these cubes from a single shape file.

Best regards,
Matthias



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Combining-shp-Files-and-csv-Data-tp7583245p7583248.html
Sent from the R-sig-geo mailing list archive at Nabble.com.