[R] How can I save plot()/points() using SHP files into KML format?

MacQueen, Don macqueen1 at llnl.gov
Wed Mar 14 21:34:46 CET 2012


Since you found readOGR, you might want to look at writeOGR.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 2/22/12 3:43 PM, "gztourek" <gztourek at gmail.com> wrote:

>Hi,
>
>I am new to R and am a very basic user.  I'm importing SHP files, adding
>plots of random locations within my polygon (these files have GPS data),
>and
>then want to save these plots (intact with added points) as KML files to
>look at in GoogleEarth (or possibly as SHP files which I can then convert
>into KML).
>
>This is as far as I've gotten (code below) and am lost as to next steps,
>Any suggestions or references would be greatly appreciated!  Thanks in
>advance for any help.
>
>Gabe
>
># Initialize pseudo random number generator
>
>  set.seed(700124)
>
># Read vector representation of the map
>
>  Kasur <- readOGR("Kasur3.shp", layer = "Kasur3")
>  
>
># Plot points
>  png("Kasur.png")
>  plot(Kasur)
>  points(spsample(Kasur, n=100, type='random'), col='red', pch=0, cex=0.5)
>  dev.off()
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/How-can-I-save-plot-points-using-SHP-files-i
>nto-KML-format-tp4412220p4412220.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list