Learn R Programming

GEOmap (version 2.1)

SELGEOmap: Select parts of a GEOmap

Description

Using area, number of points and Lat-Lon Limits, extracts map strokes and creates a new GEOmap

Usage

SELGEOmap(MAP, ncut = 3, acut = c(0, 1e+05), proj = NULL, LIM = NULL)

Arguments

MAP
Map structure
ncut
minimum number of points in polygon
acut
vector, min and max of areas to include
proj
map projection
LIM
vector, c(lon1, lat1, lon2, lat2)

Value

  • GEOmap LIST
  • STROKESlist
  • namname of stroke
  • numnumber of points in stroke
  • indexindex of stroke
  • colcolor of stroke
  • stylestyle of stroke
  • codecode of stroke
  • LAT1lower left Lat of stroke
  • LAT2upper right Lat of stroke
  • LON1lower left Lon of stroke
  • LON2upper right Lon of stroke
  • POINTSlist
  • latvector of lats
  • lonvector of lons

Details

Uses splancs function. If proj and LIM are NULL then no selection on limits are used ncut is used to eliminate area calculations with strokes less than the specified number.

See Also

geoarea

Examples

Run this code
library(geomapdata)
data(worldmap)
skam = SELGEOmap(worldmap, ncut=3, acut=c(10000, Inf), proj=NULL, LIM=NULL)

par(mfrow=c(2,1))

#######  plot world map, with all lines:
plotGEOmap(worldmap)
length(worldmap$STROKES$num)
######   same plot with some lines removed:
plotGEOmap(skam)
length(skam$STROKES$num)

#####################
#####################

Run the code above in your browser using DataLab