Tuesday, May 29, 2012

Google Earth and ocean depth contours

Been playing around in R for a while and then a bit in the GIS environment - within R of course. Do not know very much about GIS, but know what I want: Looking at GIS fisheries data across various scales (macro to global). Now we have myriads of websites that provide a view, on a 'data' on a scale. But herein lies the limitation, it is piecemeal information. Now what GIS software medium actually operates on all scales? Who else to call than Google Earth?
Here is an snapshot of the depth contours for from 0 to 1500 m by 100 meter intervals for the whole of the North Atlantic. Original data is from General Bathymetric Chart of the Oceans. All that was needed was some lines of code in R to convert point values to contour and then generate the kml-file. And adding on top of that the ICES statistical rectangles as a layer, coloured in red.

Zooming in or out in Google Earth environment is a breeze. An example on the macroscale, showing the Porupine bank is shown below.

Wandering if one should not use the Google Earth as the base platform to publish all fisheries and management information. Both the global as well as the local.

Monday, May 28, 2012

ICES and NAFO statistical areas viewed in Google Earth

On the ICES Spatial Facility webpage one can obtain a view of the ICES statistical areas. Now since the projection used is more than a bit misleading I was wandering how these statistical areas would look like in Google Earth. Thankfully the shapefiles associated with these rectangles are available to download  from the web page. What follows is less than a bare bone code to convert the shape files into kml files. Except that a bit of a thinning of the spatial codes was needed because the original shapefiles are very detailed for some of the coastal areas resulting in very nonsmoothed zooming etc. in Google Earth. While doing this I also included the NAFO areas. Since I also wanted to see the EEZ on top of this I include a code to convert EEZ shapefiles to kml. The EEZ data were downloaded from the VLIZ Maritime Boundaries Geodatabase.

Before running the code below, one needs to download the necessary data onto the local machine and extract the data from the zipped file into a working directory (not needed for NAFO areas - is included in the code below). Once this has been done the following code was used to convert the data into Google Earth format:

# gpclibPermit() # may be needed
# ices areas
ices_areas = readOGR('ices_areas.shp','ices_areas')
ices_areas <- thinnedSpatialPoly(ices_areas,tolerance=0.04) # takes some time
# world eez
eez <- readOGR('World_EEZ_v6_1_simpliefiedcoastlines_20110512.shp',
writeOGR(eez, "eez.kml", "eez", driver="KML")
# nafo areas
nafo_areas <- readOGR('NAFOdivisions.shp','NAFOdivisions')
Created by Pretty R at inside-R.org

Now one only needs to open the  kml files (ices_areas.kml, nafo_area.kml and eez.kml, located in the working directory) in Google Earth. If there are problems with downloading or running the scripts I provide the ices_areas.kmlnafo_areas.kml and eez.kml via my Public Dropbox space (there is also a depth contour in the E-Greenland, Iceland Faero Is. region, see nwwgDepth.kml)
As said, this is very much a bare bone attempt but at least describes the essence of getting a GE view of the ICES and NAFO statistical areas. Zooming in and out is a breeze and by clicking on an area some statistics show up. A snapshot of the broad view as presented in the projection on the ices page vs. the one provided in Google Earth are shown for comparisons. The global EEZ are a bonus :-)