R and Google Earth ~ comparing tuna tracks vs. Gulf of Mexico oil spill extent

[This article was first published on mind of a Markov chain » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

There is a lot of interest in how the Gulf of Mexico oil gusher will affect the ecosystem and its marine species. One such species is the Western Atlantic bluefin tuna that holds the Gulf of Mexico as one of its major spawning grounds. Recent tag data show that the location of the gusher is also very close to its spawning ground both spatial and temporally (Teo and Block 2010). Some other effects (pdf).

I thought it would be cool to plot this on Google Earth, using tools from RKML.

I have 2003 and 2004 tracking data of Gulf bluefin tuna by GTOPP, along with the layers provided by NOAA-NESDIS, collected into one .kmz file by Google.

RKML does easy translations from lat-lon data into KML. Using kmlTime(), I can create an animation by specifying exact dates. I equalized the years of the tracking data to 2010 since the layers come from different years, although they are labelled correctly. Below is the animation that shows both data on a 2-week time span. We see that there is some overlap in early June.

embedded screencast w/ Jing. (note: if movie doesn’t play, that means it has reached its monthly bandwidth limit)

A screenshot:


# http://gtopp.org/data/downloads.html
# http://mola.stanford.edu/public/kochevar/GTOPP_LC/dasets/Atlantic%20bluefin%20tuna%205103535%20Gulf.zip
# http://mw1.google.com/mw-earth-vectordb/disaster/oil_slick_042010/dynamic/noaa_spill_extent.kmz

blue.gulf <- read.table("./Atlantic bluefin tuna 5103535 Gulf.txt", sep = "t", head = T)
blue.gulf$Date.Time <- strptime(blue.gulf$Date.Time, "%m/%d/%y")

names(blue.gulf) <- c("time", "longitude", "latitude")

styles = list("ball_green" =
  list("IconStyle" = list("scale" = "0.5",
         "Icon" = c("href" = system.file("Icons", "greendot.png", package = "RKML"))),
       "BalloonStyle" = "$description"),
  "ball_red" =
  list("IconStyle" = list("scale" = "0.5",
         "Icon" = c("href" = system.file("Icons", "reddot.png", package = "RKML"))),
       "BalloonStyle" = "$description"),
  "line_green" = list(LineStyle = list(color = I("ff8adfb2"), width = 4)),
  "line_red" = list(LineStyle = list(color = I("ff999afb"), width = 2)))

blue.gulf03 <- blue.gulf[which(blue.gulf$time$year == 103),]
rownames(blue.gulf03) <- blue.gulf03$time
blue.gulf03$time <- strptime(paste("2010", blue.gulf03[,1]$mon+1, blue.gulf03[,1]$mday, sep = "-"), "%Y-%m-%d")

blue.gulf04 <- blue.gulf[which(blue.gulf$time$year == 104),]
rownames(blue.gulf04) <- blue.gulf04$time
blue.gulf04$time <- strptime(paste("2010", blue.gulf04[,1]$mon+1, blue.gulf04[,1]$mday, sep = "-"), "%Y-%m-%d")

blue.03 <- kmlTime(blue.gulf03, col = rep("ball_green", len = nrow(blue.03)), lty = rep("line_green", len = nrow(blue.03)), addLines = T, styles = styles)
saveXML(blue.03, "blue03.kml")

blue.04 <- kmlTime(blue.gulf04, col = rep("ball_red", len = nrow(blue.04)), lty = rep("line_red", len = nrow(blue.04)), addLines = T, styles = styles)
saveXML(blue.04, "blue04.kml")


  1. Teo SL, & Block BA (2010). Comparative influence of ocean conditions on yellowfin and atlantic bluefin tuna catch from longlines in the gulf of Mexico. PloS one, 5 (5) PMID: 20526356

Add to: Facebook | Digg | Del.icio.us | Stumbleupon | Reddit | Blinklist | Twitter | Technorati | Yahoo Buzz | Newsvine

Filed under: Fisheries, Geography, R, RKML

To leave a comment for the author, please follow the link and comment on their blog: mind of a Markov chain » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)