getmapdata: Read GSHHS map data for specified region

Description Usage Arguments Value Note Author(s)

Description

This function is a wrapper around Rgshhs in maptools. It reads GSHHS data for a specified bounding box (geographical positions) and makes them available to create maps. Further projection of data is done using proj4.

Remember that the GSHHS contains map data in different resolution as well as nation borders and rivers. This function reads maps only.

GSHHS files have filenames of the form 'gshhs_X.b', where X is one of the letters c, l, i, h, and f, corresponding to increasing resolution (and file size).

The file gshhs_c.b contains the crudest resolution which is suitable for global or large regional maps.

Some issues concerning reading large scale GSHHS data have been identified. Until the fix is available, this dataset should be used for high resolution maps and avoided for global maps. For those, use e.g. wrld_simpl of maptools or the rworldmap package.

Usage

1
    getmapdata(fn,xl=c(-80,80),yl=c(0,90),shift=T,level=1,no.clip=F,...)

Arguments

fn

Filename to read data from.

xl

Longitude bounds

yl

Latitude bounds

shift

Transform longitudes around Greenwich if true

level

Control which parts of database to read

no.clip

Contro clipping of polygons, see Rgshhs for details

...

Additional arguments to Rgshhs

Value

Part of the object returned by Rgshhs

Note

Part of the code used here was published by Karl Ove Hufthammar in a discussion on maptools posted at https://stat.ethz.ch/pipermail/r-sig-geo/2010-October/009630.html

Sometimes it is easier to use the Shapefiles provided for GSHHS as these avoid some problems in the Eastern part of Russia. These files are easily read using rgdal and readOGR followed by fortify and modification of column names.

Author(s)

Øystein Godøy (o.godoy@met.no)


steingod/R-makemymap documentation built on May 30, 2019, 2:31 p.m.