Jesse,
The clipping of the larger map by a smaller region works perfectly, but the
resulting map (the clipped version) has the data component of the SP object
missing. I can't merge anything if the data component is not there. I have
tried directly using the gintersection function to clip the map but that seems
to fail (waited more than 2 hours for the program to run).
When I run the command: slotNames(czout) I should get an object of name "data"
along with the other 4 components below
but I only get,
I get: [1] "polygons" "plotOrder" "bbox" "proj4string"So, somehow
the "data" object is getting lost. I am fairly new to GIS, I just found the
code for clipping on the sig-geo list and tried it and it worked, but the
"data" object is missing. I know how to merge data but I just can't figure out
how to recover the "data" component of the SP object.
Ravi
> Date: Fri, 22 Nov 2013 08:36:52 -0800
> From: berman.je...@gmail.com
> To: r-sig-geo@r-project.org
> Subject: Re: [R-sig-Geo] Clipping a Map
>
> Hi Ravi,
>
> After performing 'gIntersects' try merging this result to your dataframe,
> then select the TRUE values?
>
> Jesse
>
> cz_zip <- gIntersects(camapzip_temp,camap_base, byid=TRUE)
> camap_base@data<-cbind(camap_base@data, czip)
> camap2<-camap_base[(camap_base@data[,/???/] %in% c("TRUE)),] # Insert your
> column number for czip in place of ???
>
> plot(camap2)
> head(camap2@data)
>
>
>
> -----
> --------------------------------------------------------
> Jesse D Berman, PhD
> Yale University
> School of Forestry and Environmental Studies
> Post-Doc Fellow
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Clipping-a-Map-tp7585156p7585162.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo