tag:blogger.com,1999:blog-2418399086931873533.post431155574202697358..comments2014-11-04T08:49:41.309-08:00Comments on fishvice: Google Earth and ocean depth contourseinar hjörleifssonhttp://www.blogger.com/profile/03811120168583854238noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2418399086931873533.post-41504964434749869822014-11-04T08:49:41.309-08:002014-11-04T08:49:41.309-08:00i think the R-code was something like this:
requi...i think the R-code was something like this:<br /><br />require(rgdal) # check<br />library(ncdf)<br />require(maptools)<br />gpclibPermit()<br />options(max.contour.segments = 100000)<br /><br />d=open.ncdf("data/gebco_08_-45_30_0_60.nc")<br /><br />sec30=30/3600 <br />sec15=15/3600 <br />xs <- seq(from= -45,to= 0,by=sec30)<br />xs <- xs[-length(xs)]+sec15 # get the mid point<br />ys <- seq(from=30,to=60,by=sec30)<br />ys <- ys[-length(ys)]+sec15 # get the mid point<br />xss = rep(xs,times=length(ys)) # expand<br />yss = rep(ys,each=length(xs))<br />spp = SpatialPoints(data.frame(x=xss,y=yss))<br />gt = points2grid(spp) # Create grid topology<br /><br />z = get.var.ncdf(d,"z") <br />sgdf = SpatialGridDataFrame(gt, data=as.data.frame(z),CRS("+proj=longlat +datum=WGS84"))<br /><br /><br /><br />dLevels <- c(-50,seq(-100,-1400,by = -100)) # could not get further down<br />aDepth = contourLines(as.image.SpatialGridDataFrame(sgdf),<br /> levels=dLevels)<br />aDepth = ContourLines2SLDF(aDepth)<br />proj4string(aDepth)=CRS("+proj=longlat +datum=WGS84")<br /><br />writeOGR(aDepth, "aDepth.kml",c(as.character(dLevels)),driver="KML")<br />einar hjörleifssonhttps://www.blogger.com/profile/03811120168583854238noreply@blogger.comtag:blogger.com,1999:blog-2418399086931873533.post-18223883088047260552014-11-04T06:33:15.551-08:002014-11-04T06:33:15.551-08:00Very interesting, I also want to reproduce this an...Very interesting, I also want to reproduce this and incorporate similar content to google earth.<br /><br />Can I maybe receive the r scripts<br /><br />Kind regards Maarten de Jongmaartenhttps://www.blogger.com/profile/13293821206805529671noreply@blogger.comtag:blogger.com,1999:blog-2418399086931873533.post-81945993094295011322013-04-12T13:49:06.746-07:002013-04-12T13:49:06.746-07:00Fascinating post! Any chance you could send me the...Fascinating post! Any chance you could send me the kml file of the depth contours? Via dropbox perhaps? It would be fun to try to reproduce this.<br /><br />Mark Huisjes,<br />markhuisjes@hotmail.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2418399086931873533.post-86505418358062162202013-02-18T03:43:15.052-08:002013-02-18T03:43:15.052-08:00Howdy! I can clearly notice the fact that you deep...Howdy! I can clearly notice the fact that you deeply understand what you are speaking about over here. Do you own a degree or an education which is linked with the theme of the entry? Thanks a lot in advance for your answer.OffTheSpeedLimithttp://offspeedlimit.wordpress.com/noreply@blogger.com