SELGEOmap function

Select parts of a GEOmap

Select parts of a GEOmap

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

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)

Details

Uses sf::st_area 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.

Returns

GEOmap LIST - STROKES: list

  • nam: name of stroke

  • num: number of points in stroke

  • index: index of stroke

  • col: color of stroke

  • style: style of stroke

  • code: code of stroke

  • LAT1: lower left Lat of stroke

  • LAT2: upper right Lat of stroke

  • LON1: lower left Lon of stroke

  • LON2: upper right Lon of stroke

  • POINTS: list

  • lat: vector of lats

  • lon: vector of lons

Author(s)

Jonathan M. Leesjonathan.lees@unc.edu

See Also

geoarea, sf::st_area

Examples

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) ##################### #####################
  • Maintainer: Jonathan M. Lees
  • License: GPL (>= 2)
  • Last published: 2024-07-09

Useful links