QDEC Lab Group
  • Home
  • People
  • Research
  • Teaching
  • Publications
  • Software
  • Prospective Students
  • Links
  • R learning page
  • Null Models
    • MPower
    • CoOccur >
      • TestMatricesCO
    • Fixit
    • Contact
  • CDC_COE_PD
  • TickTechPosition2021
  • DL
  • SICA_GeoAnalyst
#In this script, we are going to import a Shapefile (ESRI)
#and then export a KML file for google earth

#June 27, 2013

#Make sure you are in the right directory where your file is
#KNOW YOUR PROJECTION - in this case, we all know the gps units were in
#WGS84, and we're okay with that

#load necessary packages
library(rgdal)
library(maptools)

#first read the shapefile - in this case, locations of pan traps for EAB work
YPT30<-readOGR(".", "YPT_points_1_30")

#You can plot it, to see if the import worked
plot(YPT30)

#see if it has any attributes to worry about
names(YPT30)

#Now export this as KML
#make sure to include any attributes we want to have stuck to the points
writeOGR(YPT30, dsn="YPT30.kml", layer="YPT30", driver = "KML")
Proudly powered by Weebly