Learn R Programming

GEOmap (version 2.5-11)

fixCoastwrap: Correct the Wrapping problem

Description

Correct wrapping for GEOmaps

Usage

fixCoastwrap(Z, maxdis = 100)

Value

List:

x

x-coordinates (longitudes)

y

y-coordinates (latitudes)

Arguments

Z

list of x, y

maxdis

maximum distance for differences

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

Details

Based on mapswrap program

Examples

Run this code
data(coastmap)
SEL = which(coastmap$STROKES$nam=="AFROASIA")

A = ExcludeGEOmap(coastmap, SEL, INOUT="in")

plot(A$POINTS$lon, A$POINTS$lat, type='n')

points(A$POINTS$lon, A$POINTS$lat, pch='.')

######  note that the map wraps around.

B = fixCoastwrap(list(x=A$POINTS$lon, y=A$POINTS$lat), 100)
 which(is.na(B$x))



lines(B)


polygon(B, col=rgb(.8,1, .8))



Run the code above in your browser using DataLab