Home > GHCN > Coastal Distance: Sitting on the Dock of the Bay

Coastal Distance: Sitting on the Dock of the Bay

2010 March 30


GHCN v2 includes 2 coastal fields: a two character string describing the coastal type (coastal, lake, island, or ‘no’) and a two character field giving the distance to the coast if it is 30km or less (-9 for na). GHCN has this to say about the coastal location.

Coastal locations. Oceanic influence on climate can be significant, so these metadata include (a) if the station is located on an island of less than 100 km2 or less than 10 km in width at the station location, (b) if the station is located within 30 km of the coast it is labeled as coastal and the distance to the coast is provided, and (c) if the station is adjacent to a large (greater than 25 km2) lake, that too is noted because it can have an influence on a station’s climate

Peterson and Vose, 1997, An Overview of the Global Historical Climatology Network Temperature Database


A special call-out to spatial-analyst.net.

spatial-analyst.net is a non-commercial website intended for users interested in advanced use of geocomputational tools. The topics discussed generally belong to spatio-temporal data analysis sciences, digital cartography, geomorphometry, geostatistics, geovisualization, GPS navigation, raster-based GIS modelling and similar.


Spatial-analyst has a collection of data sets and descriptions of GIS related tools. Their Global Datasets page includes a ‘Distance from the Coast’ (shown below) data set which is derived from the Word Vector Shoreline. The DCOAST data is in ArcInfo Ascii Gridded format (*.asc) with 1/10th degree resolution (~10km). It has coverage from 85S-85N.

Distance from Coast | http://spatial-analyst.net


The ArcInfo Ascii Gridded data was converted to GeoTiff with the gdal_translate utility.

gdal_translate -of GTiff dcoast.asc dcoast.tif

The GeoTiffDataReader class was updated to handle signed integers. Once done, it was easy to process data in the same manner as the previous DMSP and Olson Ecosystem.


Once again, there is a good match-up** between the GIS data and the GHCN metadata. Of the 7280 station in the inventory, 4532 are listed as ‘not coastal’ in both data sets and 2072 are listed as ‘coastal’ in both data sets (defined as 30km or less from coast). 108 station are coastal in the GHCN data but not in the DCOAST data. 125 stations are coastal in DCOAST but not in GHCN. In addition, there are 443 lake stations (LA) in the GHCN data that are not addressed in this post. I calculate a (119+117)/7280 mismatch rate of 3.2% which leads to a 96.8% match rate.

A station inventory with the new coastal data is here: v2.coastal.inv
(Negative distances are indicated by -1)

The ‘stacked’ comparison file is here: v2.compare.inv

For those who want to see just the Coastal data, this file includes the GHCN stnid, GHCN Coastal flag, GHCN Coastal Distance, DCOAST flag, DCOAST distance: ghcn-co-co.inv


I was rather doubtful of using a data set with 10km resolution when the coastal definition was only 30km. So the strong match was rather surprising to me.

Still need to include Lake data.

Despite the reference to ‘IS – Island’, this designation is not used in v2.temperature.inv.

The spatial-analyst is a great starter site for a GIS newb like me. Tip of the hat to them! They also point to GIS capabilities in R. Lots of new stuff to learn there.

Updated the data sets to set the coastal distance to ‘-1’ if the distance is <0 and to change the coastal definition from <30km to <=30km.


** Before the update count was:
7280 station in the inventory
4540 are listed as 'not coastal' in both data sets 2061 are listed as 'coastal' in both data sets
119 station are coastal in the GHCN data but not in the DCOAST data.
117 stations are coastal in DCOAST but not in GHCN.
443 lake stations (LA).
(119+117)/7280 mismatch rate of 3.24%
96.76% match rate.

  1. 2010 March 31 at 3:09 am

    That’s great.

    With some of peters tools you can create kmz files of all of the stations and then just merrily click through them in google earth.

  2. 2010 March 31 at 6:06 am

    I just realized that the large negative distances (<-30) are showing up as blanks in the *inv files. I'll update those tonight.

  3. 2010 April 2 at 9:17 am

    Thanks ron,

    Zeke has asked that I put this in the online compilation of metadata,

    what is the meaning of a negative distance from the coast?

    I’ll check back and let me know when the files are updated

  4. 2010 April 2 at 9:49 am

    Hey Ron

    Just as a double check I posted this for you.


    The GHCNids also include stations that are read in by GISS ( antartic stations not in GHCN)

    I’ve added everything except your latest on vegatation.

  5. 2010 April 2 at 10:14 am

    Added in the Olson stuff,

    Since the website reads in your stuff with a crude tool it sometimes sees
    feilds where there are none.

    So GHCNid, Bogs, Bogs woods Get read in as three feilds. Anyways, I corrected all those

    here is the lastest, which you can download ( other formats ) to double check


  1. No trackbacks yet.
Comments are closed.