Get LAT-LON points that fall inside a map

Share:

Description

Get LAT-LON points that fall inside a map

Usage

1
insideGEOmapXY(lat, lon, PROJ = NULL, R = NULL, PMAT = NULL)

Arguments

lat

vector of latitudes

lon

vector of longitudes

PROJ

projection structure

PMAT

persp matrix for perspective plot

R

List(lat, lon, radius) for selecting instead of using usr coordinates

Details

The parameters par("usr") is queried and used to select the lat and lons that fall within the mapped region. If the list R=list(lat, lon, radius) is provided, then all indeces of points falling within that radius are returned.

Value

Vector of index values for points that satisfy geographic criteria

Author(s)

Jonathan M. Lees<jonathan.lees.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

data('japmap', package='geomapdata' )
isel1 = which( japmap$STROKES$code != "i" & japmap$STROKES$num>120 )

 PROJfuji = setPROJ(type = 2, LAT0=35.358,LON0=138.731)
plotGEOmapXY(japmap, PROJ=PROJfuji, SEL=isel1 , add=FALSE)
pointsGEOmapXY(gvol$lat, gvol$lon,  PROJ=PROJfuji)
textGEOmapXY(gvol$lat, gvol$lon, gvol$name,  PROJ=PROJfuji, pos=4,
cex=.5)
wv =insideGEOmapXY(gvol$lat, gvol$lon, PROJfuji)
cbind(gvol$name[wv], gvol$lat[wv], gvol$lon[wv])



## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.