GEOmap
GEOmap
R topics documented:
GEOmap-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
addLLXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
addTIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
along.great . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
antipolygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
BASICTOPOMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
bcars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
boundGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
CCcheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ccw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
coastmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1
2 R topics documented:
ColorScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
darc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
DATUMinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
demcmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
difflon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
distaz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
dms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
DUMPLOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
EHB.LLZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Ellipsoidal.Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
eqswath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
ExcludeGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
expandbound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
explode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
ExplodeSymbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
faultdip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
faultperp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
fixCoastwrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
gclc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
geoarea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
geoLEGEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
GEOmap.breakline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
GEOmap.breakpoly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
GEOmap.cat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
GEOmap.CombineStrokes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
GEOmap.Extract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
GEOmap.list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
GEOsymbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
GEOTOPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
getETOPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
getGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
getGEOperim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
getgreatarc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
getmagsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
getnicetix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
getspline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
getsplineG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
GETXprofile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
GLOB.XY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
GLOBE.ORTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
GlobeView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
gmat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
goodticdivs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
horseshoe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
inpoly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
insertNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
insertvec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
inside . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
R topics documented: 3
insideGEOmapXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
KINOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
lamaz.eqarea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
LandSeaCol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
lcgc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
linesGEOmapXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Lintersect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
list.GEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
ll2xyz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Lll2xyz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
LLlabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
LOCPOLIMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
locworld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Lxyz2ll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
MAPconstants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
maplim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
maps2GEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
mapTeleSeis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Markup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
merid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
niceLLtix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
NoOverlap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
normalfault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
NSarrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
NSWath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
ortho.proj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
OverTurned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
perpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
pgon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
pline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
plotGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
plotGEOmapXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
plothypos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
plotnicetix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
plotusa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
plotUTM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
plotworldmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
PointsAlong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
polyintern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
printGEOinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
printGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
projtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
rectPERIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
rekt2line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
rose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
rotateGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
rotdelta4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
rotmat2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
4 GEOmap-package
rotx4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
roty4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
SELGEOmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
setMarkup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
setplotmat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
SETPOLIMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
setPROJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
settopocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
sizelegend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
sqrTICXY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
SSfault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
STROKEinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
subsetTOPO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
SynAnticline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
targetLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
teeth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
thrust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
TOPOCOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
trans4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
UTM.ll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
utm.sphr.ll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
utm.sphr.xy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
UTM.xy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
utmbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
UTMzone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
X.prod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
XSECDEMg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
XSECEQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
XSECwin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
XY.GLOB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
xyz2ll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
zebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Index 182
GEOmap-package GEOmap
Description
Topographic and Geologic Mapping
GEOmap-package 5
Details
Package: GEOmap
Type: Package
Version: 1.6-09
Date: 2012-10-08
License: GPL
Set of routines for making Map Projections (forward and inverse), Topographic Maps, Perspective
plots, geologi cal databases, interactive plotting and selection of focus regions.
Note
High level plotting: BASICTOPOMAP DOTOPOMAPI geoLEGEND GEOsymbols locworld plot-
GEOmap plotGEOmapXY linesGEOmapXY rectGEOmapXY textGEOmapXY pointsGE-
OmapXY insideGEOmapXY plotUTM plotworldmap XSECDEM
PLOTTING: circle addLLXY addTIX antipolygon zebra demcmap setXMCOL shade.col
Geological Map Symbols: bcars faultdip faultperp horseshoe normalfault OverTurned perpen teeth
thrust SynAnticline SSfault
Data manipulation: getGEOmap boundGEOmap SELGEOmap geoarea GEOTOPO getGEOperim
GETXprofile Lintersect LOCPOLIMAP pline selectPOLImap setplotmat SETPOLIMAP set-
topocol subsetTOPO
Misc: getgreatarc ccw difflon DUMPLOC getsplineG inpoly inside PointsAlong polyintern
Projections: setPROJ projtype GLOB.XY XY.GLOB MAPconstants GCLCFR lambert.cc.ll lam-
bert.cc.xy lambert.ea.ll lambert.ea.xy lcgc merc.sphr.ll merc.sphr.xy utmbox utm.elps.ll utm.elps.xy
utm.sphr.ll utm.sphr.xy stereo.sphr.ll stereo.sphr.xy equid.cyl.ll equid.cyl.xy
Author(s)
Jonathan M. Lees<jonathan.lees.edu> Maintainer:Jonathan M. Lees<[email protected]>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
Lees, J. M., Geotouch: Software for Three and Four Dimensional GIS in the Earth Sciences, Com-
puters & Geosciences, 26, 7, 751-761, 2000.
See Also
RSEIS
Examples
################ projections
proj = setPROJ(type = 2, LAT0 =23, LON0 = 35)
6 addLLXY
PLOC=list(LON=KAMlon,LAT=KAMlat)
Description
Usage
Arguments
lats Latitudes in Degrees
lons Longitude in Degrees
PROJ Map Projection list
PMAT Perspective matrix conversion
col color
GRID logical, TRUE=add grid lines
GRIDcol color for grid lines
LABS vector of labels
LABcol color for labels
BORDER add border
TICS tick marks
xpd logical, expand plotting region (see par)
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
plotGEOmapXY, sqrTICXY
Examples
library(geomapdata)
data('fujitopo', package='geomapdata')
data('japmap', package='geomapdata')
PLOC=list(LON=range(c( japmap$STROKES$LON1,japmap$STROKES$LON2) ),
LAT=range(c( japmap$STROKES$LAT1,japmap$STROKES$LAT2) ))
PLOC$x = PLOC$LON
PLOC$y = PLOC$LAT
PLAT = pretty(A$LAT)
PLAT = c(min(A$LAT), PLAT[PLAT>min(A$LAT) & PLAT<max(A$LAT)],max(A$LAT))
PLON = pretty(A$LON)
PLON = c(min(A$LON), PLON[PLON>min(A$LON) & PLON<max(A$LON)],
max(A$LON))
###############
Description
Add Tic marks to map
Usage
addTIX(lats, lons, PROJ = list(), PMAT = NULL,
col = gray(0.7), TICS = c(1, 1), OUTER = TRUE,
sides = c(1, 2, 3, 4))
Arguments
lats Latitudes in Degrees
lons Longitude in Degrees
PROJ Map Projection list
PMAT Perspective matrix conversion
col color
TICS tic labels
OUTER logical
sides sides, 1,2,3,4
Details
attempts to make correct default values
Value
Graphical Side Effects
along.great 9
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
addLLXY
Examples
PLOC=list(LON=c(137.008, 141.000),
LAT=c(34.000, 36.992),
x=c(137.008, 141.000),
y=c(34.000, 36.992))
PLAT = pretty(PLOC$LAT)
PLAT = c(min(PLOC$LAT),PLAT[PLAT>min(PLOC$LAT)&PLAT<max(PLOC$LAT)],max(PLOC$LAT))
PLON = pretty(PLOC$LON)
Description
Calculate points along a great arc
10 antipolygon
Usage
along.great(phi1, lam0, c, Az)
Arguments
phi1 start lat, radians
lam0 start lon, radians
c distance, radians
Az Azimuthal direction, radiansm
Details
All input and output is radians
Value
List:
Author(s)
Jonathan M. Lees<[email protected]>
Examples
lat1 <- 48.856578
lon1 <- 2.351828
lat=A$phi*180/pi
lon = A$lam*180/pi
Description
Fill a plot with a color outside the confines of a polygon.
Usage
antipolygon(x, y, col = 0, corner=1, pct=.4)
antipolygon 11
Arguments
x x coordinates of polygon
y y coordinates of polygon
col Fill color
corner Corner on the plot to connect to at the end: 1 = LowerLeft(default) ; 2:UpperLeft
3 = UpperRight; 4=LowerRight
pct Decimal percent of usr coordinates to expand beyond the polygon
Details
antipolygon uses par("usr") to determine the external bounds of plotting region. Corners are labels
from bottom left counter-clockwise, 1-4.
Value
List:
x x-coordinates of mask
y y-coordinates of mask
Used for graphical side effect
Note
If the figure is resized after plotting, filling may not appear correct.
Author(s)
Jonathan M. Lees <[email protected]>
See Also
polygon, par
Examples
set.seed(2018)
x = runif(100)
y = runif(100)
plot(x,y)
########### create polygon:
pp =list(x=c(0.231,0.316,0.169,0.343,0.311,0.484,0.757,
0.555,0.800,0.563,0.427,0.412,0.203),
y=c(0.774,0.622,0.401,0.386,0.138,0.312,0.200,0.459,
0.658,0.624,0.954,0.686,0.813))
polygon(pp)
12 BASICTOPOMAP
antipolygon(x=pp$x, y=pp$y,col='blue')
#### where as this does not look so good
plot(x,y)
antipolygon(x=pp$x, y=pp$y,col='blue', corner=2)
Description
Basic Topogrpahy Map
Usage
BASICTOPOMAP(xo, yo, DOIMG, DOCONT, UZ, AZ, IZ, perim, PLAT, PLON,
PROJ = PROJ, pnts = NULL, GRIDcol = NULL)
Arguments
xo vector of x-coordinates
yo vector of y-coordinates
DOIMG logical, add image
DOCONT logical, add contours
UZ matrix of image values under sea level
AZ matrix of image values above sea level
IZ matrix of image values
perim perimeter vectors
PLAT latitudes for tic-marks
PLON longitude for tic-marks
PROJ projection list
pnts points to add to plot
GRIDcol color for grid
Details
Image is processed prior to calling
Value
Graphical Side effects
BASICTOPOMAP 13
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
DOTOPOMAPI, GEOTOPO
Examples
## Not run:
library(geomapdata)
library(MBA) ## for interpolation
####### set up topo data
data(fujitopo)
##### set up map data
data('japmap', package='geomapdata' )
PLOC$x =PLOC$LON
PLOC$y =PLOC$LAT
########## select data from the topo data internal to the target
topotemp = list(lon=fujitopo$lon, lat= fujitopo$lat, z=fujitopo$z)
xo = IZ[[1]]
yo = IZ[[2]]
### image(IZ)
PLAT = c(min(PLOC$LAT),
PLAT[PLAT>min(PLOC$LAT) & PLAT<max(PLOC$LAT)],max(PLOC$LAT))
PLON = pretty(PLOC$LON)
## End(Not run)
Description
Add Box Cars to a line.
bcars 15
Usage
bcars(x, y, h1 = 1, h2 = 0.3, rot, col = "black", border = "black")
Arguments
x x-coordinates
y y-coordinates
h1 length, mm
h2 thickness, mm
rot rotation vectors, (cosines and sines)
col color
border color
Details
Used for plotting detachment faults in USGS format.
Value
Graphical Side effects
Author(s)
Jonathan M. Lees<[email protected]>
Examples
G=list()
G$x=c(-1.0960,-0.9942,-0.8909,-0.7846,-0.6738,-0.5570,-0.4657,-0.3709,
-0.2734,-0.1740,-0.0734, 0.0246, 0.1218, 0.2169, 0.3086, 0.3956, 0.4641,
0.5293, 0.5919, 0.6530, 0.7131)
G$y=c(-0.72392,-0.62145,-0.52135,-0.42599,-0.33774,-0.25896,-0.20759,
-0.16160,-0.11981,-0.08105,-0.04414,-0.00885, 0.02774, 0.06759, 0.11262,
0.16480, 0.21487, 0.27001, 0.32895, 0.39044, 0.45319)
sk = 3
###############
plot(G$x, G$y, type='n',asp=1, axes=FALSE, xlab='', ylab='')
lines(G$x,G$y,col='blue')
bcars(g$x,g$y,h1=sk,h2=sk*.5, rot=g$rot , col='blue')
###############
16 boundGEOmap
Description
Given a GEOmap strucutre, set the bounds for the strokes.
Usage
boundGEOmap(MAP, NEGLON = FALSE, projtype = 2)
Arguments
MAP GEOmap structure
NEGLON whether to allow negative longitudes
projtype suggestion (local) map projection to use when getting bounds
Details
Used to rectify a new map after reading in from ascii file. Can take GMT map ascii map files and
convert to GEOmap.
Value
List structure:
STROKES list(nam, num, index, col, style, code, LAT1, LAT2, LON1, LON2)
POINTS list(lat, lon)
PROJ list(type, LAT0, LON0, LAT1, LAT2, LATS, LONS, DLAT, DLON, FE, FN,
name)
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
worldmap
CCcheck 17
Examples
library(geomapdata)
data(worldmap)
worldmap = boundGEOmap(worldmap)
Description
Check for counter-clockwise orientation for polygons. Positive is counterclockwise.
Usage
CCcheck(Z)
Arguments
Z list(x,y)
Details
Uses sign of the area of the polygon to determine polarity.
Value
j sign of area
Note
Based on the idea calculated area of a polygon.
Author(s)
Jonathan M. Lees<[email protected]>
Examples
Y=list()
Y$x=c(170,175,184,191,194,190,177,166,162,164)
Y$y=c(-54,-60,-60,-50,-26,8,34,37,10,-15)
points(Y)
lines(Y)
CCcheck(Y)
Z = list(x=rev(Y$x), y=rev(Y$y))
CCcheck(Z)
Description
Used for determining if points are in polygons.
Usage
ccw(p0, p1, p2)
Arguments
p0 point 0
p1 point 1
p2 point 2
Value
returns 1 or 0 depending on position of points
Author(s)
Jonathan M. Lees <[email protected]>
See Also
Lintersect
Examples
Description
Global Maps of Coast
Usage
data(coastmap)
Format
List structure:
STROKES list(nam, num, index, col, style, code, LAT1, LAT2, LON1, LON2)
POINTS list(lat, lon)
PROJ list(type, LAT0, LON0, LAT1, LAT2, LATS, LONS, DLAT, DLON, FE, FN, name)
Details
This map list is used for filling in coastal lines for global maps. The style=3 is for filling in polygons.
The strokes are named for easier access to particular parts ofthe globe. Asia and Africa are one
stroke, as are North and South America. there are currently three codes: C=major coast, c=smaller
coasts, L=interior lakes.
Examples
data(coastmap)
####### see the codes:
unique(coastmap$STROKES$code)
######### see the different names:
unique(coastmap$STROKES$nam)
##
20 ColorScale
Description
Graded Color Scale position by locator
Usage
ColorScale(z, loc = list(x = 0, y = 0), thick=1, len=1, offset=.2, col
= rainbow(100),border='black', gradcol='black',numbcol='black', unitscol='black',
units = "", SIDE = 1, font = 1, fontindex =1, cex=1)
Arguments
z values to be scaled
loc x-y location boundary of plotting area, user coordinates
thick width of scale bar in inches
len length of scale bar in inches
offset offset from border, in inches
col color palette
border color for border of scale, NA=do not plot
gradcol color for gradiation marks of scale, NA=do not plot
numbcol color for number values of scale, NA=do not plot
unitscol color for units character string, NA=do not plot
units character, units for values
SIDE side, 1,2,3,4 as in axis
font vfont number
fontindex font index number
cex character expansion, see par for details
Details
Locations (loc) are given in User coordinates. The scale is plotted relative to the location provided
in user coordinates and offset by so many inches outside that unit. to get a scale plotted on the
interior of a plot, send ColorScale a rectangular box inside the plotting region and give it a 0 offset.
All other measures are given in inches. To suppress the plotting of a particular item, indicate NA
for its color.
Since the list of the bounding box is returned, this can be used to modify the text, e.g. change the
way the units are displayed.
ColorScale 21
Value
list Graphical Side effects and list of bounding box for color scale:
x x coordinates of box
y y coordinates of box
Author(s)
Jonathan M. Lees<[email protected]>
See Also
HOZscale
Examples
data(volcano)
d = dim(volcano)
x=seq(from=1,by=1, length=d[1]+1)
y=seq(from=1,by=1, length=d[2]+1)
plot(range(x), range(y), type='n', asp=1, ann=FALSE, axes=FALSE)
z=volcano
XAX = pretty(x)
XAX = XAX[XAX>=min(x) & XAX<=max(x)]
YAX = pretty(y)
YAX = YAX[YAX>=min(y) & YAX<=max(y)]
XAX = pretty(x)
XAX = XAX[XAX>=min(x) & XAX<=max(x)]
YAX = pretty(y)
YAX = YAX[YAX>=min(y) & YAX<=max(y)]
###########################
XAX = pretty(x)
XAX = XAX[XAX>=min(x) & XAX<=max(x)]
YAX = pretty(y)
YAX = YAX[YAX>=min(y) & YAX<=max(y)]
XAX = pretty(x)
XAX = XAX[XAX>=min(x) & XAX<=max(x)]
YAX = pretty(y)
YAX = YAX[YAX>=min(y) & YAX<=max(y)]
XAX = pretty(x)
XAX = XAX[XAX>=min(x) & XAX<=max(x)]
YAX = pretty(y)
YAX = YAX[YAX>=min(y) & YAX<=max(y)]
Description
Usage
Arguments
rad radius
ang1 angle 1, degrees
ang2 angle 2, degrees
x1 x location, plot coordinates
y1 y location, plot coordinates
n increment for number of segments, degrees
Details
Value
list(x,y)
Author(s)
Jonathan M. Lees<[email protected]>
Examples
lines(A$x, A$y)
26 DATUMinfo
Description
Return a small data base of Datum values for use in UTM projections.
Usage
DATUMinfo()
Details
The function just return a list with the relavent information.
Value
List:
Author(s)
Jonathan M. Lees<[email protected]>
References
websource = https://stevedutch.net/usefuldata/utmformulas.htm
See Also
UTM.xy, UTM.ll, setPROJ
Examples
h = DATUMinfo()
data.frame(h)
demcmap 27
Description
create a color map from a DEM (Digital Elevation Map)
Usage
demcmap(ZTOPO, n = 100, ccol = NULL)
Arguments
ZTOPO Topography structure
n number of colors
ccol color structure
Value
vector of rgb colors
Author(s)
Jonathan M. Lees<[email protected]>
See Also
rgb, settopocol
Description
Difference between Longitudes
Usage
difflon(LON1, LON2)
Arguments
LON1 Longitude in degrees
LON2 Longitude in degrees
28 distaz
Details
takes into account crossing the zero longitude
Value
deg degrees difference
sn direction of rotation
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
Examples
difflon( 34 , 67)
Description
Calculate distance, Azimuth and Back-Azimuth from two points on Globe.
Usage
distaz(olat, olon, tlat, tlon)
Arguments
olat origin latitude, degrees
olon origin longitude, degrees
tlat target latitude, degrees
tlon target longitude, degrees
Details
Program is set up for one origin (olat, olon) pair and many target (tlat, tlon) pairs given as vectors.
If multiple olat and olon are given, the program returns a list of outputs for each.
If olat or any tlat is greater than 90 or less than -90 NA is returned and error flag is 0.
If any tlat and tlon is equal to olat and olon, the points are coincident. In that case the distances are
set to zero, but the az and baz are NA, and the error flag is set to 0.
distaz 29
Value
List:
del Delta, angle in degrees
az Azimuth, angle in degrees
baz back Azimuth, (az+180) in degrees
dist distance in km
err 0 or 1, error flag. 0=error, 1=no error, see details
Author(s)
Jonathan M. Lees<[email protected]>
See Also
along.great, getgreatarc
Examples
targ[3,1] = -91.3
Description
Usage
dms(d1)
Arguments
d1 decomal degrees
Value
list
d degrees
m minutes
s seconds
Author(s)
Jonathan M. Lees<[email protected]>
Examples
dms(33.12345)
H = dms(-91.8765)
print(H)
newH = H$d+H$m/60+H$s/3600
print(newH)
DUMPLOC 31
Description
For saving vectors to a file after the locator function has been executed.
Usage
Arguments
Value
Author(s)
Jonathan M. Lees<[email protected]>
Examples
G=list()
G$x=c(-1.0960,-0.9942,-0.8909,-0.7846,-0.6738,-0.5570,-0.4657,-0.3709,
-0.2734,-0.1740,-0.0734, 0.0246, 0.1218, 0.2169, 0.3086, 0.3956, 0.4641,
0.5293, 0.5919, 0.6530, 0.7131)
G$y=c(-0.72392,-0.62145,-0.52135,-0.42599,-0.33774,-0.25896,-0.20759,
-0.16160,-0.11981,-0.08105,-0.04414,-0.00885, 0.02774, 0.06759, 0.11262,
0.16480, 0.21487, 0.27001, 0.32895, 0.39044, 0.45319)
Description
Global Earthquake catalog locations from Engdahl, et al.
Usage
data(EHB.LLZ)
Format
lat Latitude
lon Longitude
z depth in km
Source
Data is extrcted from an earthquake data base of relocated events provided by Robert Engdahl.
References
Engdahl, E. R., R. D. van der Hilst, S. H. Kirby, G. Ekstrom, K. M. Shedlock, and A. F. Sheehan
(1998), A global survey of slab structures and internal processes using a combined data base of
high-resolution earthquake hypocenters, tomographic images and focal mechanism data, Seismol.
Res. Lett., 69, 153-154.
Examples
data(EHB.LLZ)
## maybe str(EHB.LLZ) ; plot(EHB.LLZ) ...
Description
Ellipsoidal Distance given Latitude and Longitude
Usage
Ellipsoidal.Distance(olat, olon, tlat, tlon, a = 6378137, b = 6356752.314, tol=10^(-12))
Ellipsoidal.Distance 33
Arguments
olat Origin Latitude, degrees
olon Origin Longitude, degrees
tlat Target Latitude, degrees
tlon Target Longitude, degrees
a major axis, meters. If missing uses the
b minor axis, meters
tol Tolerance for convergence, default=10^(-12)
Details
Uses Vincenty’s formulation to calculate the distance along a great circle on an ellipsoidal body.
If a and be are not provided, they are set by default to a=6378137.0 , b=6356752.314, the WGS-84
standard.
Only one pair of (olat, olon) and (tlat, tlon) can be given at a time. The program is not vectorized.
Quoting from the wiki page this algorithm was extracted from:
"Vincenty’s formulae are two related iterative methods used in geodesy to calculate the distance
between two points on the surface of an spheroid, developed by Thaddeus Vincenty in 1975. They
are based on the assumption that the figure of the Earth is an oblate spheroid, and hence are more
accurate than methods such as great-circle distance which assume a spherical Earth.
The first (direct) method computes the location of a point which is a given distance and azimuth
(direction) from another point. The second (inverse) method computes the geographical distance
and azimuth between two given points. They have been widely used in geodesy because they are
accurate to within 0.5 mm (.020 sec) on the Earth ellipsoid"
Value
list
dist distance, km
az azimuth, degrees
revaz reverse azimuth, degrees
err =0, if convergence failed, else=1
Note
Latitudes >90 and < -90 are not allowed. NA’s are returned.
If points are identical, a distance of zero is returned and NA for the azimuths. If there is some
problems with convergence or division by zero, NA’s are returned and error message is printed.
A couple of known cases that do not work are, e.g.: (olat=0; olon=0; tlat=0; tlon=-180) and (olat=0;
olon=0; tlat=0; tlon=180). They will return NA’s to avoid division by zero.
I am not sure how to deal with these cases yet.
The reverse azimuth is the angle from the meridian on the target point to the great circle from the
origin to the target (as far as I can tell). If distaz and Ellipsoidal.Distance are compared, they give
34 Ellipsoidal.Distance
the same azimuth, and the absolute angles of baz (from distaz) and revaz (from Ellipsoidal.Distance)
will add to 180 degrees.
Author(s)
Jonathan M. Lees<[email protected]>
References
http://en.wikipedia.org/wiki/Vincenty%27s_formulae
Vincenty, T. (April 1975). Direct and Inverse Solutions of Geodesics on the Ellipsoid with ap-
plication of nested equations. Survey Review XXIII (misprinted as XXII) (176): 88.201393.
http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf. Retrieved 2009-07-11.
See Also
distaz
Examples
R.MAPK = 6378.2064
N =20
dif1 = da$dist-ed1$dis
dif2 = da$dist-ed2$dis
pct1 = 100*dif1/ed1$dist
Ellipsoidal.Distance 35
############## OUT = format( c(da$dist, ed2$dist, ed1$dist, dif2, dif1, pct1) , digits=10)
OUT$dadist[i] =da$dist
OUT$ed2dist[i] =ed2$dist
OUT$ed1dist[i]=ed1$dist
OUT$dif2[i]= dif2
OUT$dif1[i]=dif1
OUT$pct1[i]=pct1
print( data.frame(OUT) )
BOUT = list(olat=0, olon=0, tlat=0, tlon=0, dadist=0, ed2dist=0, daaz=0, ed2az=0, dabaz=0, ed2baz=0)
R.MAPK = 6378.2064
for(i in 1:length(Alat))
{
olat = Alat[i]
olon = Alon[i]
tlat = Blat[i]
tlon = Blon[i]
BOUT$olon[i] =olon
BOUT$olat[i] =olat
BOUT$tlat[i] =tlat
BOUT$tlon[i] =tlon
BOUT$dadist[i] =da$dist
BOUT$ed2dist[i] =ed2$dist
BOUT$daaz[i]= da$az
36 eqswath
BOUT$dabaz[i]= da$baz
BOUT$ed2az[i]= ed2$az
BOUT$ed2baz[i]= ed2$revaz
print(data.frame(BOUT))
Description
Extract a set of eathquakes in swath along a cross sectional line
Usage
eqswath(x, y, z, L, width = 1, PROJ = NULL)
Arguments
x x-coordinates of earthquakes
y y-coordinates of earthquakes
z z-coordinates of earthquakes
L list of x-y coordinates of cross section
width width of swath (km)
PROJ projection information
Details
All units should be the same.
Value
r r-distance along cross section (x-coordinate)
dh distance from cross seection
depth depth in cross section (y-coordinate)
flag index vector of which earthquakes fell in swath and depth range
InvBox coordinates of swath for plotting on map
ExcludeGEOmap 37
Author(s)
Jonathan M. Lees<[email protected]>
See Also
XSECwin, XSECEQ
Examples
L=list()
L$x=c( 5.42328560757,64.62879777806)
L$y=c(89.843266449785,-0.174423911329)
Description
Select sections of a MAP-list structure based on stroke index
Usage
ExcludeGEOmap(MAP, SEL, INOUT = "out")
Arguments
MAP Map List
SEL Selection of stroke indeces to include or exclude
INOUT text, "in" means include, "out" means exclude
38 expandbound
Value
MAP list
Author(s)
Jonathan M. Lees<[email protected]>
See Also
getGEOmap, plotGEOmap, SELGEOmap, boundGEOmap
Examples
data(coastmap)
Description
Calculate an expanded bounding region based on a percent of the existing boundaries
Usage
expandbound(g, pct = 0.1)
Arguments
g vector of values
pct fractional percent to expand
Details
uses the range of the exising vector to estimate the expanded bound
Value
vector, new range
explode 39
Author(s)
Jonathan M. Lees<[email protected]>
Examples
i = 5:10
exi = expandbound(i, pct = 0.1)
range(i)
range(exi)
Description
Explode a set of points away from a center point
Usage
explode(fxy, dixplo=1, mult=1, cenx=0, ceny=0, PLOT=FALSE)
Arguments
fxy list of x, y coordinates
dixplo distance to explode
mult multiplier for the distance
cenx x coordinate center of explosion
ceny y coordinate center of explosion
PLOT logical, TRUE=make a plot of the resulting explosion
Details
If cenx and ceny is missing it is assumed to be the mean of the coordinates. Program calculates the
new locations radiating away from the central point. No protection against overlapping symbols is
included.
Value
list of new x,y values
x new x coordinates
y new y coordinates
40 ExplodeSymbols
Author(s)
Jonathan M. Lees<[email protected]>
See Also
ExplodeSymbols, NoOverlap
Examples
Description
Interactive program for redistributing symbols for later plotting. Used for Focal Mechanisms.
ExplodeSymbols 41
Usage
ExplodeSymbols(XY, fsiz = 1, STARTXY = NULL, MAP = NULL)
Arguments
XY list of x,y values
fsiz size of the symbol, as a percentage of the user coordinates
STARTXY Starting positions. This is used for multiple sessions where we want to pick up
the previous locations.
MAP Map to plot on the screen, in GEOmap format.
Details
The program is interactive. It starts by plotting the points as symbols. A number of buttons are
provided for exploding the points semi automatically. To move each point click near its current
point, then click at the destination followed by a click on the HAND button. several symbols can
be moved at the same time.
You must click on the screen and on the buttons to get this code working - the program will not
work in batch mode or run as a script You click in the active screen area and then press a button on
top (or bottom) - the button takes your clicks and does something Here are some hints:
Buttons:Buttons appear on top and bottom of the plotting region.
HAND: If you want to move only one symbol (focal mech) click near it and then click where you
want it to go. Then click the HAND button You may click several at once, but for each click oin a
symbol there has to be a click somewhere to relocate it. (i.e. there must be an even number of clicks
on the screen before hitting the HAND button)
SEL: If you want to explode several symbols at once, first select them: click lower left, then upper
right of rectangle enclosing the selection. Once a selection is made it remains active until another
selection is made so you can keep changing the radius and center for different explosions Then click
CIRC.
RECT Choose a rectangle (lower left and upper right), then click RECT for an explosion
RECT2 After selecting, choose a center and a distance. symbols will be moved to a rectangular
perimeter defined by the two points
CIRC After selection, click once for the circle center, and a second time for the radius, then click
CIRC
LINE After selection,will explode the events away from a line, a given distance away. The line is
given by 2 points and the distance by a third perpendicular distance.
Value
list of new x,y values
Note
For now the map is given in lat-lon coordinates- the same as the points being moved. There is no
map projection used.
42 faultdip
Author(s)
Jonathan M. Lees<[email protected]>
See Also
rekt2line
Examples
## Not run:
F1 = list(x=rnorm(43), y=rnorm(43))
SMXY = ExplodeSymbols(F1, 0.03)
## End(Not run)
Description
Show Fault dip
Usage
faultdip(x, y, rot = 0, h = 1, lab = "")
Arguments
x x-coordinates
y y-coordinates
rot cosine and sine of rotation
h length of mark
lab labels
Value
Graphical Side effect
Author(s)
Jonathan M. Lees<[email protected]>
faultperp 43
See Also
perpen, PointsAlong, getsplineG
Examples
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
angs = 180*atan(g$rot$sn/g$rot$cs)/pi
faultdip(g$x , g$y , rot=angs, h=.5, lab='')
Description
Draw perpendicular marks on fault trace
Usage
faultperp(x, y, N = 20, endtol = 0.1, h = 1, col = "black")
Arguments
x x-coordinates
y y-coordinates
N number of points
endtol indent on either ends
h length of perpendicular marks
col color of line
Value
Graphical Side effect
44 fixCoastwrap
Author(s)
Jonathan M. Lees<[email protected]>
See Also
OverTurned
Examples
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
Description
Usage
Arguments
Z list of x, y
maxdis maximum distance for differences
Details
Value
List:
x x-coordinates (longitudes)
y y-coordinates (latitudes)
Author(s)
Jonathan M. Lees<[email protected]>
Examples
data(coastmap)
SEL = which(coastmap$STROKES$nam=="AFROASIA")
lines(B)
Description
OLD projection sometimes used in Lees’ tomography. No need for projection data, it is included in
the code.
Usage
gclc(phiorg, lamorg, phi, lam)
46 geoarea
Arguments
phiorg lat origin
lamorg lon origin
phi lat
lam lon
Details
This may be defunct now.
Value
x coordinate, km
y coordinate, km
Note
Orignally from R. S. Crosson
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
lcgc
Examples
gclc(23, 35, 23.5, 35.6)
Description
vector of areas of polygons in map
Usage
geoarea(MAP, proj=NULL, ncut=10)
Arguments
MAP Map structure
proj projection
ncut minimum number of points in polygon
geoLEGEND 47
Details
Uses splancs function. If proj is NULL then the project is reset to UTM spherical for each element
seperately to calculate the area in km. ncut is used to eliminate area calculations with strokes less
than the specified number.
Value
vector of areas
Note
areas smaller than a certain tolerance are NA
Author(s)
Jonathan M. Lees<[email protected]>
Description
Create and add Geological legend from GEOmap Structure
Usage
geoLEGEND(names, shades, zx, zy, nx, ny, side=1, cex=0.5)
Arguments
names namesof units
shades colorsof units
zx width of box, mm
zy height of box, mm
nx number of boxes in x-direction
ny number of boxes in y-direction
side Side of the plot for the legend (1,2,3,4)
cex Character expansion for text in legend
Details
Adds geological legend based on information provided. Legend is placed in margin.
Value
Graphical Side Effects
48 geoLEGEND
Note
If plot is resized, should re-run this as the units depend on the screen size information and the
transformation of user coordinates.
Author(s)
Jonathan M. Lees<[email protected]>
Examples
## Not run:
library(RPMG)
library(RSEIS)
library(GEOmap)
library(geomapdata)
data(cosogeol)
data(cosomap)
data(faults)
data(hiways)
data(owens)
proj = cosomap$PROJ
XMCOL = setXMCOL()
newcol = XMCOL[cosogeol$STROKES$col+1]
cosocolnums = cosogeol$STROKES$col
cosogeol$STROKES$col = newcol
ss = strsplit(cosogeol$STROKES$nam, split="_")
UGEO = unique(geo)
ucol = unique(gcol)
N = length(ucol)
spucol = strsplit(ucol,split="\.")
geoLEGEND 49
ORDN = order(names)
### example:
####
par(mai=c(0.5, 0.5, 1.0, 0.5) )
####
par(mai=c(0.5, 0.5, 0.5, 1) )
####
par(mai=c(1.5, 0.5, 0.5, 0.5) )
## End(Not run)
50 GEOmap.breakpoly
Description
Break a line at specified indices into a list
Usage
GEOmap.breakline(Z, ww)
Arguments
Z list of x,y location values
ww index vector of break locations
Value
newx list x of strokes
newy list y of strokes
Author(s)
Jonathan M. Lees<[email protected]>
Examples
Y=list()
Y$x=c(170,175,184,191,194,190,177,166,162,164)
Y$y=c(-54,-60,-60,-50,-26,8,34,37,10,-15)
GEOmap.breakline(Y, 5)
Description
Break up a polygon
Usage
GEOmap.breakpoly(Z, ww)
GEOmap.cat 51
Arguments
Z list, x,y locations
ww vector of indecies where NAs occur
Details
The NA values in Z represent breaks. GEOmap.breakpoly breaks the polygon up into individual
strokes. The beginning and the ending of the stroke are combined.
Value
newx list of x values
newy list of y values
Author(s)
Jonathan M. Lees<[email protected]>
See Also
fixCoastwrap, GEOmap.breakline
Examples
x=1:100
y = 1:100
A = list(x=x, y=y)
W = GEOmap.breakpoly(A , ww)
Description
Combine Two GEOmaps into one
Usage
GEOmap.cat(MAP1, MAP2)
52 GEOmap.CombineStrokes
Arguments
MAP1 GEOmap list
MAP2 GEOmap list
Details
Maps are combine consecutively.
Value
GEOmap list
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOmap.Extract, GEOmap.CombineStrokes, list.GEOmap
Examples
data(coastmap)
CUBA = GEOmap.Extract(coastmap,90, INOUT="in" )
Description
Combine strokes in a GEOmap list
Usage
GEOmap.CombineStrokes(MAP, SEL)
Arguments
MAP GEOmap list
SEL index of strokes to be combined
GEOmap.Extract 53
Details
Stokes are combined in the order designated by the SEL index vector. The direction of the strokes
is not modified - this may have to be fixed so that strokes align properly.
Value
GEOmap list
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOmap.cat, GEOmap.Extract, GEOmap.CombineStrokes, list.GEOmap
Examples
data(coastmap)
SEL = which(coastmap$STROKES$nam=="Caribbean")
Description
Extract or Exclude parts of a GEOmap list.
Usage
GEOmap.Extract(MAP, SEL, INOUT = "out")
fastExtract(MAP, SEL, INOUT = "out")
GEOmap.limit(MAP, LLlim )
54 GEOmap.list
Arguments
MAP GEOmap List
SEL Selection of stroke indeces to include or exclude
INOUT text, "in" means include, "out" means exclude
LLlim vector latlon limits
Details
Can either extract from the GEOmap data list with in, or exclude with out. fastExtract is the same
but may be faster since it does not process all the strokes in the base GEOmap.
Value
GEOmap list
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOmap.cat, GEOmap.Extract, GEOmap.CombineStrokes, list.GEOmap, getGEOmap, plotGE-
Omap, SELGEOmap, boundGEOmap,
Examples
data(coastmap)
SEL=which(coastmap$STROKES$nam=="AMERICAS")
NSAMER = GEOmap.Extract(coastmap,SEL, INOUT="in" )
plotGEOmap(NSAMER)
Description
Inverse of list.GEOmap.
Usage
GEOmap.list(MAP, SEL = 1)
Arguments
MAP GEOmap list
SEL index, selecttion of specific strokes
GEOsymbols 55
Details
Returns the GEOmap strokes and instead of a long vector for the points they are broken down into
a list of strokes.
Value
STROKES Metadata for strokes
POINTS list, lat=vector, lon=vector
LL list of lat-lon strokes
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOmap.cat, GEOmap.Extract, GEOmap.CombineStrokes, list.GEOmap
Examples
data(coastmap)
SEL=which(coastmap$STROKES$nam=='CUBA')
G = GEOmap.list(coastmap, SEL=SEL )
GEOsymbols GEOsymbols
Description
Plot a set of Geological Symbols
Usage
GEOsymbols()
Details
Currently the choices in symbols are:
contact anticline syncline OverTurned-ant OverTurned-syn perp thrust normal dextral sinestral
detachment bcars
56 GEOTOPO
Value
Graphical Side effect
Author(s)
Jonathan M. Lees<[email protected]>
See Also
bcars, thrust, teeth, SynAnticline, SSfault, horseshoe, strikeslip, OverTurned, normalfault, PointsA-
long
Examples
GEOsymbols()
Description
Extract subset of a topographic database, interpolate and plot using the persp program.
Usage
GEOTOPO(TOPO, PLOC, PROJ, calcol=NULL, nx=500, ny=500, nb = 4, mb = 4, hb = 8, PLOT=TRUE)
Arguments
TOPO list of x,y,z for a DEM
PLOC Location list, includes vectors LON and Lat
PROJ projection
calcol color table for coloring elevations above sea level
nx number of points in x grid, default=500
ny number of points in y grid, default=500
nb see function mba.surf, default = 4
mb see function mba.surf, default = 4
hb see function mba.surf , default= 8
PLOT logical, TRUE=plot a map and return color map
GEOTOPO 57
Details
The return matrix PMAT is a rotation matrix used for adding geographic (projected) data onto the
perspective plot.
ETOPO5 or ETOPO2 can be downloaded from and installed using these links: http://leesj.
sites.oasis.unc.edu/FETCH/GRAB/RPACKAGES/ETOPO2.RData and http://leesj.sites.oasis.
unc.edu/FETCH/GRAB/RPACKAGES/ETOPO5.RData
Value
PMAT Matrix from persp, used for adding other geographic information
xo x-coordinates
yo y-coordinates
IZ interpolated elevations
Cmat matrix of RGB Colors
Dcol dimensions of Cmat
Note
If PLOT is false the transform matrix PMAT and the color mapping matrix Cmat will be returned
as NA. To create these for future plotting, use TOPOCOL or LandSeaCol functions. TOPOCOL
simply assigns values above sea level with one color scale and those below with under water colors.
LandSeaCol requires a coastal map and fills in land areas with terrain colors and sea areas with blue
palette colors.
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
subsetTOPO, TOPOCOL, LandSeaCol, settopocol, subsetTOPO, persp, DOTOPOMAPI
Examples
## Not run:
library(geomapdata)
JMAT = GEOTOPO(ETOPO5, PLOC, PROJ, COLS$calcol, nx=1000, ny=1000, nb=8, mb=8, hb=12, PLOT=TRUE)
## End(Not run)
Description
Extract from ETOPO5 or ETOPO2 data a rectangular subset of the full data.
Usage
getETOPO(topo, glat = c(-90, 90), glon = c(0, 360))
Arguments
topo A DEM matrix, ETOPO5 or ETOPO2
glat 2-vector, latitude limits
glon 2-vector, longitude limits (these are converted 0-360
Details
ETOPO2 and ETOPO5 are stored in a strange way: the lons are okay the latitudes are upside down.
ETOPO5 or ETOPO2 can be downloaded from and installed using these links: http://leesj.
sites.oasis.unc.edu/FETCH/GRAB/RPACKAGES/ETOPO2.RData and http://leesj.sites.oasis.
unc.edu/FETCH/GRAB/RPACKAGES/ETOPO5.RData
Value
Returns a matrix with attributes in lat-lon that are correct for usage in image or other R imaging
programs.
Author(s)
Jonathan M. Lees<[email protected]>
getGEOmap 59
See Also
image
Examples
## Not run:
library(geomapdata)
### Download and install ETOPO Data
## data(ETOPO5)
load(ETOPO5)
glat =c(45.4, 49)
glon = c(235, 243)
b5 = getETOPO(ETOPO5, glat, glon)
image(x=attr(b5, 'lon'), y=attr(b5,'lat'), z=b5, col=terrain.colors(100) )
contour( x=attr(b5, 'lon'), y=attr(b5,'lat'), z=b5, add=TRUE)
## End(Not run)
Description
Get Geomap from ascii files
Usage
getGEOmap(fn)
Arguments
fn root name
Details
Files are stored as a pair: rootname.strks and rootname.pnts
Value
STROKES List of stroke information:
nam name of stroke
num number of points
index index where points start
col color
style plotting style: 1=point, 2=line,3=polygon
code character, geological code
60 getGEOmap
Author(s)
Jonathan M. Lees<[email protected]>
See Also
plotGEOmapXY, boundGEOmap
Examples
## Not run:
library(geomapdata)
data(cosomap)
data(faults)
data(hiways)
data(owens)
cosogeol = getGEOmap("/home/lees/XMdemo/GEOTHERM/cosogeol")
cosogeol = boundGEOmap(cosogeol)
proj = cosomap$PROJ
## End(Not run)
getGEOperim 61
Description
Get rectangular perimeter of region defined by set of Lat-Lon
Usage
getGEOperim(lon, lat, PROJ, N)
Arguments
lon vector of lons
lat vector of lats
PROJ projection structure
N number of points per side
Details
perimeter is used for antipolygon
Value
List:
x x-coordinates projected
y y-coordinates projected
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
Examples
PLOC$x =PLOC$LON
PLOC$y =PLOC$LAT
Description
Get points along great circle between two locations
Usage
getgreatarc(lat1, lon1, lat2, lon2, num)
Arguments
lat1 Latitude, point 1 (degrees)
lon1 Longitude, point 1 (degrees)
lat2 Latitude, point 2 (degrees)
lon2 Longitude, point 2 (degrees)
num number of points along arc
Value
lat Latitude
lon Longitude
Author(s)
Jonathan M. Lees<[email protected]>
See Also
getgreatarc, distaz
Examples
PARIS = c(48.8666666666667, 2.33333333333333)
RIODEJANEIRO =c( -22.9, -43.2333333333333)
lines(g$lon+180, g$lat)
getmagsize 63
Description
Estimate a size for plotting earthqukes recorded as a logarithmic scale
Usage
getmagsize(mag, minsize = 1, slope = 1, minmag = 0, maxmag = 8, style = 1)
Arguments
mag magnitudes from catalog
minsize minimum size
slope slope for linear scale
minmag min magnitude
maxmag max magnitude
style Style of plotting: 0= all the same size; 1(default): exponential scale; 2=linear
scale
Details
The idea is to have a scale reflect the size of the earthquake. The default style (1) has a few param-
eters left over from old program geotouch.
Value
vector of sizes for plotting
Author(s)
Jonathan M. Lees<[email protected]>
Examples
mag = 0:9
x = runif(10, 1, 100)
y = runif(10, 1, 100)
g = getmagsize(mag)
Description
Given a set of lat lon pairs, return a new set of tic marks
Usage
getnicetix(lats, lons)
Arguments
lats latitude range
lons longitude range
Value
LAT list output of niceLLtix
LON list output of niceLLtix
Author(s)
Jonathan M. Lees<[email protected]>
See Also
niceLLtix
Examples
proj = setPROJ(7, LAT0 = 0 , LON0= -93)
rx = c(652713.4, 656017.4)
ry = c(1629271, 1631755)
G = getnicetix(gloc$lat, gloc$lon)
print(G)
getspline 65
Description
Usage
getspline(x, y, kdiv)
Arguments
x x-coordinates
y y-coordinates
kdiv number of divisions in each sections
Value
LIST:
x x-coordinates
y y-coordinates
Author(s)
Jonathan M. Lees<[email protected]>
Examples
plot(c(-5,5), c(-5,5), asp=1, type='n' )
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
lines(ff, col='red')
G =getspline(ff$x, ff$y, kdiv=20)
lines(G, col='blue')
66 getsplineG
Description
Usage
getsplineG(x, y, kdiv)
Arguments
x x-coordinates
y y-coordinates
kdiv number of divisions in each sections
Value
LIST:
x x-coordinates
y y-coordinates
Author(s)
Jonathan M. Lees<[email protected]>
Examples
plot(c(-5,5), c(-5,5), asp=1, type='n' )
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
lines(ff, col='red')
G =getsplineG(ff$x, ff$y, kdiv=20)
lines(G, col='blue')
GETXprofile 67
Description
Example of how to use RPMG button functions. This example shows how to plot a DEM and
interactively change the plot and find projected cross-sections through a surface.
Usage
GETXprofile(jx, jy, jz, LAB = "A", myloc = NULL, PLOT = FALSE, NEWDEV=TRUE, asp=1)
Arguments
jx, jy locations of grid lines at which the values in ’jz’ are measured.
jz a matrix containing the values to be plotted
LAB Alphanumeric (A-Z) for labeling a cross section
myloc Out put of Locator function
PLOT logical. Plot is created if TRUE
NEWDEV logical. Plot is on a new device if TRUE
asp aspect ration for plotting, see par
Details
The program uses a similar input format as image or contour, with structure from the locator()
function of x and y coordinates that determine where the cross section is to be extracted.
Value
Returns a list of x,z values representing the projected values along the cross section.
Note
The program is an auxiliary program provided to illustrate the RPMG interactive R analysis.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
locator, image
68 GLOB.XY
Examples
## Not run:
####### get data
data(volcano)
#### extract dimensions of image
nx = dim(volcano)[1]
ny = dim(volcano)[2]
## End(Not run)
Description
Convert from GLOBAL LAT-LON to X-Y
Usage
GLOB.XY(LAT, LON, PROJ.DATA)
Arguments
LAT Latitude
LON Longitude
PROJ.DATA Projection list
Details
Units should be given according to the projection. This is the inverse of XY.GLOB.
GLOBE.ORTH 69
Value
x X in whatever units
y Y in whatever units
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
XY.GLOB
Examples
Description
Usage
Arguments
lam0 view origin longitude, degrees
phi1 view origin latitude, degrees
R Radius of sphere, default=1
plotmap logical, default=TRUE, add map
plotline logical, default=TRUE, add grid of lat-lons
add logical, default=FALSE, Do not start a new plot, rather add to existing plot
map GEOmap list
mapcol color for map
linecol color for meridians and parallels
fill fill polygons with color, default=FALSE
Details
Plots whole globe with grid.
Value
Graphical Side effects
Author(s)
Jonathan M. Lees<[email protected]>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
setPROJ, projtype, plotGEOmap
Examples
###### simple map of world viewed at 40 degrees latitude
R = 1
R.MAPK = 6378.2064
phi1=40
data(coastmap)
K=1
GLOBE.ORTH(viewlam[K], phi1, R=1, plotmap=TRUE)
######
GLOBE.ORTH 71
A = along.great(olat*pi/180, olon*pi/180,
seq(from=0, to=da$del, by=2)*pi/180, da$az*pi/180)
lat=A$phi*180/pi
lon = A$lam*180/pi
lines(XYalong , col='purple')
legend("topleft", legend=leg)
72 GlobeView
Description
Plot global view of the earth
Usage
GlobeView(phicen, lamcen, worldmap, MAXR, SEL = 1,
circol = rgb(1, 0.8, 0.8), innercol = "white", linecol = rgb(0, 0, 0),
mapcol = rgb(0, 0, 0), backcol = "white", add=FALSE, antip=TRUE)
Arguments
phicen Latitude
lamcen Longitude
worldmap Map List
MAXR Maximum radius (degrees)
SEL Selection index from map
circol color for concentric circles
innercol inner color
linecol line color, NA=do not plot
mapcol map fill color, NA=do not fill polygon
backcol background color
add logical, FALSE means start a new plot
antip logical, default=TRUE means white out area outside of polygon
Details
Creates a plot of view of the globe from a point in space using an Equal-Area projection. Uses
the lamaz.eqarea routine for projection. (Lambert-Azimuthal Equal Area). Using NA for linecol or
mapcol means do not plot lines or fill polygons respectively.
Value
Perimeter x,y points around the perimeter of the plot
Author(s)
Jonathan M. Lees<[email protected]>
See Also
plotGEOmap, lamaz.eqarea
gmat 73
Examples
data(coastmap)
phicen =32.20122+5
lamcen = 335.7092+20
MAXR = 100
SEL=which( coastmap$STROKES$code=="C")
SEL = c(SEL, which(coastmap$STROKES$nam=="GreatBritain"),
which(coastmap$STROKES$nam=="Japan"), which(coastmap$STROKES$nam=="Ireland"))
Description
Globe Rotation Matrix
Usage
gmat(vec, p, alpha)
Arguments
vec vector axis to rotate about
p translation point (c(0,0,0))
alpha angle to rotate, degrees
Details
Given an arbitrary axis, return matrix for rotation about the axis by alpha degrees.
Value
4 by 4 Matrix for translation and rotation
74 goodticdivs
Author(s)
Jonathan M. Lees<[email protected]>
References
Rogers and Adams
Examples
################ kamchatka
KAMLAT0=mean(kamlat)
KAMLON0=mean(kamlon)
################ korea
KORlon = c(123,133)
KORlat = c(33,44)
KORLON0=mean(KORlon)
KORLAT0=mean(KORlat)
# convert to cartesian
v1 = ll2xyz(KORLAT0, KORLON0 )
v2 = ll2xyz(KAMLAT0, KAMLON0)
Description
Determine a reasonable tick division for lat-lon tic marks.
horseshoe 75
Usage
goodticdivs(ddeg)
Arguments
Details
Designed to give approximately 4-6 divisions for plotting given the range input.
Value
K suggested divisor
Author(s)
Jonathan M. Lees<[email protected]>
See Also
niceLLtix
Examples
goodticdivs(20)
goodticdivs(100)
Description
Usage
Arguments
x x-coordinates
y y-coordinates
r1 x-radius of curled part
r2 y-radius of curled part
h1 length of first leg
h2 length of 2nd leg
rot rotation, cos, sine
col color of teeth and line
lwd line width
fill logical, TRUE=fill
Value
Grapical Side Effect
Author(s)
Jonathan M. Lees<[email protected]
See Also
PointsAlong
Examples
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
w1=list()
w1$x=c(-1.208, 0.113, 1.242, 2.200, 2.349)
w1$y=c( 3.206, 2.280, 0.344,-2.560,-3.485)
inpoly 77
Description
takes a set of points and tests with function inside()
Usage
inpoly(x, y, POK)
Arguments
x x coordinates
y y coordinates
POK polygon structure list x,y
Value
Returns vector of 0,1 for points inside polygon
Author(s)
Jonathan M. Lees <[email protected]>
See Also
Lintersect, ccw, inside
Examples
H=list()
H$x=c(-0.554,-0.258,0.062,0.538,0.701,0.332,
0.34,0.26,-0.189,0.081,0.519,0.644,0.264,
-0.086,-0.216,-0.246,-0.356,-1.022,-0.832,
-0.372,-0.463,-0.604)
H$y=c(0.047,-0.4,-0.818,-0.822,-0.314,-0.25,
-0.491,-0.589,-0.396,-0.138,0.082,0.262,0.542,
0.361,0.03,0.555,0.869,0.912,0.641,0.327,0.142,0.129)
78 insertNA
x = runif(20, -1,1)
y = runif(20, -1,1)
points(list(x=x, y=y) )
inp = inpoly(x, y, H)
Description
Inserting NA values in a vector at specific index locations
Usage
insertNA(y, ind)
Arguments
y vector
ind index locations where NA is inserted
Details
The vector is parsed out and NA values are inserted where after the index values provided.
Value
v new vector with NA’s
Author(s)
Jonathan M. Lees<[email protected]>
Examples
x = 1:10
insertNA(x, 6)
insertvec 79
Description
Inserting values in a vector at specific index locations
Usage
insertvec(v, ind, val)
Arguments
v vector
ind ndex locations where val is inserted
val some vector of insertion, maybe NA
Details
The vector is parsed out and val values are inserted where after the index values provided.
Value
v new vector with val inserted after the index
Author(s)
Jonathan M. Lees<[email protected]>
Examples
x = 1:20
Description
Given a polygon and a point, determine if point is internal to polygon. The code counts the number
of intersection the point and a dummy point with a very large x-value makes with the polygon.
Usage
inside(A, POK)
80 inside
Arguments
Value
Author(s)
See Also
Examples
l1 = list(p1=list(x=-0.83587, y=-0.5765),
p2=list(x=0.731603,y=0.69705))
l2 = list(p1=list(x=-0.6114, y=0.7745),
p2=list(x=0.48430,y=-0.63250))
Description
Get LAT-LON points that fall inside a map
Usage
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
## Not run:
data('japmap', package='geomapdata' )
isel1 = which( japmap$STROKES$code != "i" & japmap$STROKES$num>120 )
## End(Not run)
Description
Determine if strokes are in a target region
Usage
KINOUT(MAP, LLlim, projtype = 2)
Arguments
MAP GEOmap list
LLlim list: lat lon limits
projtype local projection type
Details
The limits are used to calculate an origin and each point is projected accordingly. The x-y values
are evaluated for being in or out of the target. A local projection is used - UTM (2) is the prefered
projection.
Value
Vector or indeces of strokes that intersect the target.
Note
The mercator projections do not work well with this routine.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
inpoly,
lamaz.eqarea 83
Examples
library(geomapdata)
data(worldmap)
data(coastmap)
L = list(lon=c(163.59, 182.95), lat=c(-48.998, -32.446))
k = KINOUT(worldmap,L, 2)
print( worldmap$STROKES$nam[k] )
k = KINOUT(coastmap,L, 2)
print( coastmap$STROKES$nam[k] )
plotGEOmap(testmap)
Description
Map Projection (Lambert-Azimuthal Equal Area) for global plots.
Usage
lamaz.eqarea(phi1, lam0, phi, lam, R=6371)
lamaz.inverse(phi1, lam0, x, y, R=6371 )
Arguments
phi1 Central Latitude, radians
lam0 Central Longitude
phi vector of Latitude, points for plotting, radians
lam vector of Longitude, points for plotting , radians
R radius of sphere
x position on the plot
y position on the plot
84 lamaz.eqarea
Value
x position on the plot
y position on the plot
Note
This is a projection routine that does not need to be set in advance. lamaz.inverse is the inverse of
lamaz.eqarea.
Author(s)
Jonathan M. Lees<[email protected]>
References
Snyder, J. P., 1987; Map Projections - A Working Manual. U.S. Geological Survey Professional
Paper 1395, 383 p.
See Also
setPROJ
Examples
data(coastmap)
######### coastmap is a GEOmap list
DEGRAD = pi/180
phicen = -90*DEGRAD
lamcen = 0*DEGRAD
i = 7
j1 = coastmap$STROKES$index[i]+1
j2 = j1+ coastmap$STROKES$num[i]-1
lat = coastmap$POINTS$lat[j1:j2]*DEGRAD
lon = coastmap$POINTS$lon[j1:j2]*DEGRAD
polygon(xy, col=grey(.8))
title("Antarctica")
LandSeaCol 85
Description
Color pixels with two palettes, one for land the other for sea.
Usage
LandSeaCol(IZ, coastmap, PROJ, calcol = NULL)
Arguments
IZ list of x, y, z suitable for plotting with image or contour.
coastmap coastal map from GEOmap
PROJ projection list
calcol color map for the land
Details
The program uses closed polygons in the map list to separate the pixels into land versus sea. Sea
is colored with a palette of blues, land is colored according to topographic color scheme extracted
from palettes similar to GMT palettes.
All map and pixel coordinates are projected with the same projection parameters. calculations are
done in XY coordinates.
ETOPO5 or ETOPO2 can be downloaded from and installed using these links: http://leesj.
sites.oasis.unc.edu/FETCH/GRAB/RPACKAGES/ETOPO2.RData and http://leesj.sites.oasis.
unc.edu/FETCH/GRAB/RPACKAGES/ETOPO5.RData
Value
Cmat Matrix of colors for each pixel
UZ Under water
AZ Above Sea Level
Author(s)
Jonathan M. Lees<[email protected]>
See Also
settopocol, TOPOCOL
86 LandSeaCol
Examples
## Not run:
library(geomapdata)
data(coastmap)
### data(ETOPO5)
PLOC=list(LON=Lon.range,LAT=Lat.range,lon=Lon.range,lat=Lat.range,
x=Lon.range, y=Lat.range )
Mollist =CMAT$Cmat
dMol = attr(Mollist, "Dcol")
plot(x=range(IZ$x), y=range(IZ$y),
type='n', asp=1, axes=FALSE, ann=FALSE)
lcgc 87
plotGEOmapXY(coastmap,
LIM = c(Lon.range[1],Lat.range[1] ,Lon.range[2] ,Lat.range[2]),
PROJ =PROJ,MAPstyle =2,MAPcol ="black" , add=TRUE )
## End(Not run)
Description
OLD projection sometimes used in Lees’ tomography. No need for projection data, it is included in
the code.
Usage
lcgc(phiorg, lamorg, ex, why)
Arguments
phiorg lat origin
lamorg lon origin
ex coordinate, km
why coordinate, km
Details
This may be defunct now.
Value
phi lat
lam lon
Note
Orignally from R. S. Crosson
88 linesGEOmapXY
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
gclc
Description
Add lines, points or text to GEOmap projected plot
Usage
linesGEOmapXY(lat = 0, lon = 0, PROJ = NULL, PMAT = NULL, ...)
textGEOmapXY(lat = 0, lon = 0, labels = NULL, PROJ = NULL, PMAT = NULL, ...)
pointsGEOmapXY(lat = 0, lon = 0, PROJ = NULL, PMAT = NULL, ...)
rectGEOmapXY(lat=0, lon=0, PROJ=NULL, PMAT=NULL, ... )
polyGEOmapXY(lat = 0, lon = 0, PROJ = NULL, PMAT = NULL, ...)
Arguments
lat vector of latitudes
lon vector of longitudes
labels text for labels
PROJ projection structure
PMAT persp matrix for perspective plot
... graphical Parameters from par
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
plotGEOmapXY
Lintersect 89
Description
Determines intersection points of 2D vectors
Usage
Lintersect(l1, l2)
Arguments
l1 Line 1
l2 Line 2
Value
0=no intersection 1=interesction
Author(s)
Jonathan M. Lees <[email protected]>
See Also
ccw
Examples
Lintersect(l1, l2)
Lintersect(l1, l2)
Description
List stroke points in a GEOmap
Usage
list.GEOmap(MAP, SEL = 1)
Arguments
MAP GEOmap list, with LL list
SEL index, selecttion of specific strokes
Details
Returns a GEOmap list from the output of GEOmap.list . This is used to repack a GEOmap list. Tis
function can be used to create a new geomap if you have only strokes. See example. Can be used
to convert a gmt map file (in ascii text format) to GEOmap.
Value
GEOmap list
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOmap.cat, GEOmap.Extract, GEOmap.CombineStrokes, GEOmap.list
list.GEOmap 91
Examples
data(coastmap)
length(coastmap$STROKES$nam)
G = GEOmap.list(coastmap, 1)
length(G$STROKES$nam)
H = list.GEOmap(G)
length(H$STROKES$nam)
plotGEOmap(H)
latlon=list()
latlon$lat=c(39.8780395624,39.7488080389,39.4903449921,39.2964977069,
39.1995740643,39.1349583026,38.9088031365,38.6180322088,38.3272612810,
38.0041824724,37.8749509489,37.8749509489,38.3272612810,38.4888006853,
38.8118794939,39.0057267791,39.2318819452,39.5872686346,39.9426553241)
latlon$lon=c(136.6629878969,136.3444990720,136.0715086507,136.0715086507,
135.6165246151,135.0250453689,134.9795469653,134.9795469653,135.0705437724,
135.2525373866,135.7530198258,137.0724735289,137.3454639502,137.4364607574,
138.0734384071,138.0734384071,137.8004479858,137.7549495822,137.2544671431)
GLL=list()
GLL$lat=c(38.0552647517,38.1533772893,38.2754431875,
38.3672221979,38.5260793869,38.6483246519,38.7701056377,
38.8976069603,38.9457673342,38.9998962787,39.1025327692,
39.1927889270,39.3801557421,39.5193850467)
GLL$lon=c(135.7446171004,135.8598134616,135.9053532164,
135.9978522791,136.1369466401,136.3703056863,136.6044613488,
136.8081531656,136.9649782331,137.1064020435,137.2564343909,
137.4067379892,137.5747171917,137.6637851576)
LL =list()
LL[[1]] = latlon
LL[[2]] = GLL
J = list(LL=LL)
GL = list.GEOmap(J)
plotGEOmapXY(GL)
92 Lll2xyz
Description
LAT-LON to xyz
Usage
ll2xyz(lat, lon)
Arguments
lat latitude
lon longitude
Value
3-vector
Author(s)
Jonathan M. Lees<[email protected]>
See Also
Lll2xyz, Lxyz2ll, xyz2ll
Examples
ll2xyz(12, 289)
Description
List Lat-Lon to cartesian XYZ
Usage
Lll2xyz(lat, lon)
LLlabel 93
Arguments
lat latitude
lon longitude
Value
list(x,y,z)
Author(s)
Jonathan M. Lees<[email protected]>
See Also
ll2xyz, Lxyz2ll, xyz2ll
Examples
Lll2xyz(23, 157)
Description
Create a text string for Lat-Lons
Usage
LLlabel(DD, dir = 1, ksec = -1)
Arguments
DD Decimal degrees
dir direction, NS or EW
ksec number of decimals for seconds
Details
creates text labels with minutes and seconds if needed.
Value
character string
94 LOCPOLIMAP
Author(s)
Jonathan M. Lees<[email protected]>
See Also
niceLLtix
Examples
DD = -13.12345
k = LLlabel(DD)
LOCPOLIMAP LOCPOLIMAP
Description
This program takes a point and return the continent index for database manipulation.
Usage
LOCPOLIMAP(P, MAP)
Arguments
P Point selected on screen using locator
MAP List of maps and coordinates from database
Details
Uses the CIA data base definitions.
Value
J Index to map data base
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
SETPOLIMAP
locworld 95
Examples
P = list(lat=36.09063, lon=19.44610)
LMAP = SETPOLIMAP()
J = LOCPOLIMAP(P, LMAP)
J
Description
Locate points in worlmap
Usage
locworld(shiftlon = 0, col = "brown", n = 2)
Arguments
shiftlon rotate map by degrees
col color of points
n number of points
Value
lon longitudes
lat latitudes
LON longitudes
LAT latitudes
utmbox UTM box list(lat, lon)
x UTM x-coordinates
y UTM y-coordinates
UTM0 utm origin for projection list(phi, lam)
shiftlon rotate map by degrees
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
plotworldmap
96 Lxyz2ll
Examples
library(geomapdata)
data(worldmap)
plotworldmap(worldmap)
locworld(shiftlon = 0, col = "brown", n = 2)
## End(Not run)
Description
Cartesian vector to Lat-Lon List
Usage
Lxyz2ll(X)
Arguments
X list, x,y,z
Value
list of lat and lon
Author(s)
Jonathan M. Lees<[email protected]>
See Also
xyz2ll
Examples
Lll2xyz(23, 157)
MAPconstants 97
Description
Usage
MAPconstants()
Details
These include a sime list of: DEG2RAD, RAD2DEG, A.MAPK, E2.MAPK, E2.GRS80, E.MAPK,
E1.MAPK, TwoE.MAPK, R.MAPK, FEET2M, M2FEET
Value
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
Examples
MAPconstants()
98 maplim
Description
Usage
Arguments
Details
In some (GEOmap) programs the longitude needs to be modulus 360, so these are provided also.
Value
Author(s)
Jonathan M. Lees<[email protected]>
See Also
expandbound, plotGEOmapXY
maps2GEOmap 99
Examples
plotGEOmapXY(worldmap, LIM=M$LIM)
pointsGEOmapXY(lat, lon,PROJ =PROJ, pch=6)
Description
Convert maps data to GEOmap format
Usage
maps2GEOmap(zz, wx = 1, mapnam = "temp")
Arguments
zz Output list from maps package
wx vector of breaks (in maps these are NA)
mapnam Name pasted on each stroke
Details
The program takes the output of maps and converts to a GEOmap strucuture. This code should
work with GMT style map files too.
Value
GEOmap list.
100 maps2GEOmap
Author(s)
Jonathan M. Lees<[email protected]>
Examples
library(maps)
neweng = maps2GEOmap(zz)
plotGEOmap(neweng)
## L1 = locator(1)
L1=list()
L1$x=c(283.671347071854)
L1$y=c(42.008587074537)
## L2 = locator(1)
L2=list()
L2$x=c(341.146812632372)
L2$y=c(64.9180246121089)
Description
World Map with Teleseismic Ray-paths
Usage
mapTeleSeis(sta, mylist, worldmap=NULL)
Arguments
sta list of station locations
mylist list of event locations
worldmap worldmap data (e.g. from geomapdata)
Details
Uses GEOmap. No projection is used.
Value
Graphical side effects
Author(s)
Jonathan M. Lees<[email protected]>
Examples
## Not run:
library(RSEIS)
library(GEOmap)
###################
###### set up stations
sta=list()
sta$'nam'=c("CAL", "KAM", "DOM", "LAV", "SMI", "CAS")
sta$'lat'=c(14.7421759974747,14.7471948493068,14.7422049415205,
14.7204249827467,14.7543726234568,14.710961318972)
102 mapTeleSeis
sta$'lon'=c(-91.5659793619529,-91.5698443123368,-91.5775586192333,
-91.5716896307798,-91.5518522222222,-91.5702146825397)
sta$'el'=c(2.37596727272727,2.29854436407474,2.31819590643275,
1.64286335403727,3.65216666666667,1.44584353741497)
sta$'das'=c("CAL", "KAM", "DOM", "LAV", "SMI", "CAS")
sta$'sensor1'=c("60T", "60T", "60T", "40T", "INF", "3T")
sta$'comp1'=c("VNE", "VNE", "VNE", "VNE", "VNE", "VNE")
sta$'sensor2'=c("INF", "INF", "INF", "INF", "INF", "INF")
sta$'comp2'=c("IJK", "IJK", "IJK", "IJK", "IJK", "IJK")
sta$'dasSN'=c("9FF2", "9FFE", "9FFB", "9024", "A881", "9026")
sta$'sensorSN'=c("Unknown", "Unknown", "Unknown", "T41034", "Unknown", "T3A28")
sta$'start'=c("2008:366:16:02:59:615", "2008:366:20:50:18:615",
###### "2008:366:00:58:23:849",
"2008:365:23:01:21:315", "2008:366:23:57:10:244", "2008:365:20:47:51:529")
sta$'end'=c("2009:004:18:02:58:615", "2009:004:17:50:17:615",
###### "2009:004:16:58:22:849",
"2009:006:15:01:20:315", "2009:004:16:57:09:244", "2009:005:22:47:50:529")
sta$'name'=c("CAL", "KAM", "DOM", "LAV", "SMI", "CAS")
###### get distances - this is so we can separate regional from teleseismic events
eqdists = distaz(stinfo$mlat , stinfo$mlon, eq1$lat, eq1$lon)
mylist = list()
for(j in 1:length(eq1$sec))
{
Markup 103
library(geomapdata)
data(worldmap)
mapTeleSeis(sta, mylist, worldmap=worldmap)
## End(Not run)
Description
For use in GEOmap to add labels to a geographic plot
Usage
Markup(MM = list(), sel = 1, cex = 1, ...)
Arguments
MM list of markup infromation
sel vector, select which marks to be plotted
cex character expansion
... graphical parameters for par
Details
Uses the locator function
Value
Graphical Side Effects
104 merid
Author(s)
Jonathan M. Lees<[email protected]>
See Also
setMarkup, plotGEOmapXY
Examples
## Not run:
MUP = setMarkup(LABS)
## End(Not run)
Description
Orthogonal Projection Meridian or Parallel
Usage
merid(lon, lat1=-90, lat2=90, lam0=0, phi1=41, R=1, by=1)
paral(lat, lon1=-180 , lon2=180, lam0=0, phi1=41, R=1, by=1)
Arguments
lon merid starting Longitude, degrees
lat paral starting Latitude, degrees
lam0 origin Longitude, degrees
phi1 origin Latitude, degrees
R Radius
by increment in degrees
lat1 merid starting Latitude, degrees
merid 105
Details
Retruns points along a meridian running through lat, lon with a projection based on lam0 phi.
Value
list of x-y values for plotting
Author(s)
Jonathan M. Lees<[email protected]>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
ortho.proj
Examples
olat = 0
olon = 0
tlat = 23
tlon = 30
R = 1
phi1=40
Description
Determine a nice set of coordinates in DMS
Usage
niceLLtix(rcoords)
Arguments
rcoords vector of decimal degrees, the range will be used
Value
DD decimal degrees
deg degrees
min minutes
sec seconds
si sign of degrees
Author(s)
Jonathan M. Lees<[email protected]>
See Also
dms
Examples
niceLLtix(c(12.5, 12.58) )
niceLLtix(c(12.57, 12.58) )
niceLLtix(c(91.5, 92.8) )
niceLLtix(c(-91.5, -92.8) )
niceLLtix(c(91.5, 93.8) )
NoOverlap 107
niceLLtix(c(91.5, 95.8) )
niceLLtix(c(-91.5, -95.8) )
Description
Shift Symbols such that there is no overlap
Usage
NoOverlap(x, y, focsiz, SEL = 0, OLDx = 0, OLDy = 0, cenx = 0, ceny = 0)
Arguments
x x-location
y y-location
focsiz symbol size
SEL selection of which symbols to shift
OLDx x-locations of origin
OLDy y-locations of origin
cenx center x
ceny center y
Details
Program is used for finding positions for exploding. A vector is dcalculated from each origin to
each point and explosions are projected along these directions until a position is found that does
not overlap. The position is nudged by a value of focsiz at each step. If OLDx and OLDy are not
provided, cenx and ceny are used as origin points.
Value
x,y list of new positions
Author(s)
Jonathan M. Lees<[email protected]>
See Also
ExplodeSymbols
108 normalfault
Examples
draw.circ<-function (x, y, r, ...)
{
CI = RPMG::circle(1)
for (i in 1:length(x)) {
Cx = x[i] + r * CI$x
Cy = y[i] + r * CI$y
lines(c(Cx, Cx[1]), c(Cy, Cy[1]), type = "l", ...)
}
}
x = rnorm(20)
y = rnorm(20)
rx = range(x)
ry = range(y)
drx = diff(rx)
dry = diff(ry)
XPCT=.2
rx = c(rx[1]-XPCT*drx, rx[2]+XPCT*drx)
ry = c(ry[1]-XPCT*dry, ry[2]+XPCT*dry)
u = par("usr")
u = par("usr")
segments(x,y,NXY$x, NXY$y)
Description
Plot normal fault on map.
Usage
normalfault(x, y, h = 1, hoff = 1, rot = list(cs = 1, sn = 0), col = "black")
Arguments
x x-coordinates
y y-coordinates
h radius of ball
hoff distance from line
rot rotation vectors, (cosines and sines)
col color
Details
Rotation vector is provided as list(cs=vector(), sn=vector()).
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOsymbols
Examples
G=list()
G$x=c(-1.0960,-0.9942,-0.8909,-0.7846,-0.6738,-0.5570,-0.4657,-0.3709,
-0.2734,-0.1740,-0.0734, 0.0246, 0.1218, 0.2169, 0.3086, 0.3956, 0.4641,
0.5293, 0.5919, 0.6530, 0.7131)
G$y=c(-0.72392,-0.62145,-0.52135,-0.42599,-0.33774,-0.25896,-0.20759,
-0.16160,-0.11981,-0.08105,-0.04414,-0.00885, 0.02774, 0.06759, 0.11262,
0.16480, 0.21487, 0.27001, 0.32895, 0.39044, 0.45319)
sk = 2
lines(G$x,G$y,col='blue')
Description
Add north-south weather vane arrow figure
Usage
NSarrow(x = NULL, y = NULL, R = 1, col.arrow = 1, col.N = 1,
col.circ = 1, rot = 0, PMAT = NULL)
Arguments
x X-location vector, if list, include both x and y values
y Y-location vector, not needed if x is a list
R radius, in plot coordinates
col.arrow color for arrow, default="black"
col.N color for N symbol
col.circ color for circle
rot rotation angle, degrees
PMAT projection matrix, output of persp
Details
The location list should have 2 values for x and y each, the second value for y determines the radius
R if it is not provided. The first element of y is the center of the weather vane. If no x-list is
provided, the interactive locator function is invoked and a list is returned for future work.
Value
x x-location
y y-location
Author(s)
Jonathan M. Lees<[email protected]>
See Also
zebra
NSWath 111
Examples
x=c(2,2)
y = c(8,9)
NSarrow(list(x=x, y=y))
x=c(5,5)
y = c(8,9)
Description
Set of 4 swaths for cross section across Japan
Usage
data(NSWath)
Format
list of cross sections each conists of a list of form:
Source
Data is extrcted from an earthquake data base of relocated events provided by Robert Engdahl.
112 ortho.proj
References
Engdahl, E. R., R. D. van der Hilst, S. H. Kirby, G. Ekstrom, K. M. Shedlock, and A. F. Sheehan
(1998), A global survey of slab structures and internal processes using a combined data base of
high-resolution earthquake hypocenters, tomographic images and focal mechanism data, Seismol.
Res. Lett., 69, 153-154.
Examples
## Not run:
data(NSWath)
for(i in 1:length(NSWath))
{
dev.new()
LAB = attr(NSWath[[i]], "LAB")
## End(Not run)
Description
Orthogonal Map Projection
Usage
ortho.proj(lat, lon, lon0, lat1, R)
Arguments
lat latitude, degrees
lon longitude, degrees
lon0 view origin longitude, degrees
lat1 view origin latitude, degrees
R Radius of sphere, default=1
Details
Assumes spherical globe. This function is not part of the normal GEOmap plotting routines.
OverTurned 113
Value
list
x x, coordinate in units of R
y y, coordinate in units of R
Author(s)
Jonathan M. Lees<[email protected]>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
Examples
olat = 0
olon = 0
tlat = 23
tlon = 30
R = 1
ortho.proj(tlat, tlon, olon, olat, R)
Description
Usage
Arguments
x x-coordinates
y y-coordinates
syn logical, TRUE=syncline, FALSE=anticline
spacing spacing of points
N number of points
r1 x-radius of curled part
r2 y-radius of curled part
h1 length of first leg
h2 length of 2nd leg
endtol indent on either ends
REV reverse direction of x-y
col color of teeth and line
... graphical parameters
Value
Author(s)
Jonathan M. Lees<[email protected]>
See Also
PointsAlong
Examples
OverTurned(ff$x,ff$y, r1= .4, r2= .8, h1= .5, h2= .5, N=5, syn=FALSE,
endtol=.2)
perpen 115
Description
draw perpendicular marks along line
Usage
perpen(x, y, h, rot, col = "black", lwd = 1)
Arguments
x x-coordinates
y y coordinates
h height of tooth
rot rotation of teeth
col color of line
lwd line width
Details
Used by faultperp
Value
graphical side effects
Author(s)
Jonathan M. Lees<[email protected]
See Also
PointsAlong, faultperp
Examples
plot(c(-5,5), c(-5,5), asp=1, type='n' )
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
lines(G)
116 pgon
Description
Usage
Arguments
x x-coordinate
y y-coordinate
siz radius or size
col inside color
border border color
K number of sides per polygon
startalph starting angle
... graphical parameters
Details
Value
Author(s)
Jonathan M. Lees<[email protected]>
pline 117
Examples
N = 25
x = rnorm(N)
y = rnorm(N)
z = rnorm(N)
Description
Usage
Arguments
Value
vector of:
dis distance to segment
dee distance to line
zee projection along line
px x, point of intersection
py y, point of intersection
Author(s)
Jonathan M. Lees<[email protected]>
See Also
polyintern
Examples
L=list()
L$x=c(-0.161416832868, 0.484046270443,-0.472622257679)
L$y=c(-0.735779816514, 0.306422018349, 0.192660550459)
Description
High Level plot of GEO map
Usage
plotGEOmap(MAP, LIM = c(-180, -90, 180, 90) ,
shiftlon = 0, add = TRUE ,
NUMB = FALSE , SEL = NULL, MAPcol = NULL,
MAPstyle = NULL, border=NA,
PLOT = TRUE, PRINT=FALSE, BB = FALSE, ...)
plotGEOmap 119
Arguments
MAP Map Structure
LIM Lat-Lon limits
add logical, TRUE= add to existing plot
SEL Index vector of strokes to be used in plotting, default=NULL(use all that pass
other tests)
MAPcol override color for maps
MAPstyle override plotting style for maps
border color, add border to polygons, NA=no border
shiftlon degrees, rotate longitude
NUMB logical, number the strokes on the map
PLOT logical, TRUE=plot map, else just set up plotting area
PRINT logical, TRUE=show selected stroke indeces on the screen(default=FALSE)
BB logical, TRUE=add bounding box to each stroke (default=FALSE)
... graphical parameters
Details
plotGEOmap does not plot a projected map. MAPcol and MAPstyle can be used to override the
colors and style in the map-list. These are applied to all the strokes.
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
plotGEOmapXY, DOTOPOMAPI, addLLXY
Examples
library(geomapdata)
data(coastmap)
#################### example:
coastmap$STROKES$col[coastmap$STROKES$code=="C" ] = rgb(1, .6, .6)
coastmap$STROKES$col[coastmap$STROKES$code=="c" ] = rgb(1, .9, .9)
coastmap$STROKES$col[coastmap$STROKES$code=="L" ] = rgb(.6, .6, 1)
120 plotGEOmapXY
box()
## Not run:
data(europe.bdy)
data(asia.bdy)
data(africa.bdy)
data(namer.bdy)
data(samer.bdy)
data(USAmap)
plotGEOmap(europe.bdy , add=TRUE)
plotGEOmap(asia.bdy , add=TRUE)
plotGEOmap(africa.bdy , add=TRUE)
plotGEOmap(namer.bdy , add=TRUE)
plotGEOmap(samer.bdy , add=TRUE)
plotGEOmap(USAmap , add=TRUE)
## End(Not run)
Description
Usage
plotGEOmapXY(MAP, LIM = c(-180, -90, 180, 90),
PROJ = list(), PMAT=NULL,
add = TRUE, SEL=NULL , GRID = NULL, GRIDcol = 1,
MAPcol = NULL, MAPstyle = NULL, border = NA,
cenlon = 0, shiftlon = 0, linelty = 1,
linelwd = 1, ptpch=".", ptcex=1, NUMB = FALSE, ...)
Arguments
MAP Map Structure
LIM Lat-Lon limits
PROJ Projection list
PMAT Perspective matrix conversion
add logical, TRUE= add to existing plot
SEL Index vector of strokes to be used in plotting, default=NULL(use all that pass
other tests)
GRID logical, TRUE=add grid lines
GRIDcol color for grid lines
MAPcol override color for maps
MAPstyle override plotting style for maps
border color, add border to polygons, NA=no border
cenlon center longitude of plot
shiftlon degrees, rotate longitude
linelty Line type
linelwd line width
ptpch plotting character for strokes (style=1) that are plotted as points
ptcex character expansion factor for style=1 strokes
NUMB logical, number the strokes on the map
... graphical parameters
Details
plotGEOmapXY includes projection of the data, plotGEOmap does not. MAPcol and MAPstyle
can be used to override the colors and style in the map-list. These are applied to all the strokes.
For strokes that are of style=1 points are plotted with graphical parameters ptpch="." and ptcex=1
unless otherwise indicated.
Value
Graphical Side Effects
122 plothypos
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
DOTOPOMAPI, addLLXY, plotGEOmap
Examples
data('japmap', package='geomapdata' )
isel1 = which( japmap$STROKES$code != "i" & japmap$STROKES$num>120 )
###############
#### rotated map
PMAT = rotdelta4(-34)
Description
Plot hypocenter color coded to depth and size scaled by magnitude.
plothypos 123
Usage
plothypos(lat, lon, z, proj, mag = NULL, cex = 0.4, pch =21, PMAT = NULL, alpha = NULL)
Arguments
lat Latitude
lon Longitude
z km Depth, (positive down)
proj Projection structure
mag Magnitude
cex character expansion
pch plotting character, default=21
PMAT transformation matrix
alpha transparency factor
Details
Adds hypocenters to an existing plot.
Value
Graphical Side effects.
Note
The events are color coded according to depth.
Only a few devices can handle transparency effects.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
plotGEOmapXY, XSECEQ, eqswath, getmagsize
Examples
library(geomapdata)
data('EHB.LLZ')
data('japmap', package='geomapdata')
RLAT = range(japmap$POINTS$lat)
RLON = range(japmap$POINTS$lon)
PROJ = japmap$PROJ
############## select the events in the region
isel1 = which( japmap$STROKES$code != "i" & japmap$STROKES$num>120 )
sel = which(
EHB.LLZ$lat > JLAT[1] &
EHB.LLZ$lat < JLAT[2] &
EHB.LLZ$lon > JLON[1] &
EHB.LLZ$lon < JLON[2])
sel = sel[1:200]
## Not run:
fn = "/home/lees/WORK/SENDAI.EVENT/catsearch.8757"
g = getANSS(fn, skip=2)
g$jd = getjul(g$yr, g$mo, g$dom)
sel = which(
g$lat > JLAT[1] &
g$lat < JLAT[2] &
g$lon > JLON[1] &
g$lon < JLON[2])
olat = g$lat[sel]
olon = g$lon[sel]
ordz = g$z[sel]
mag = g$mag[sel]
gm = getmagsize(mag)
## End(Not run)
Description
Find and plot nice tick marks on projected plot
Usage
plotnicetix(nex, nwhy, proj, tlen = 0.1,
fonts = c("serif", "plain"), PMAT = NULL, PLOT = TRUE)
Arguments
nex X coordinates
nwhy Y coordinates
proj prjection list
tlen length for tic marks (inches)
fonts Hershy font vector
PMAT projection matrix from persp
PLOT logical, TRUE = add to plot
126 plotusa
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
niceLLtix, goodticdivs, getnicetix, dms
Examples
rx = c(652713.4, 656017.4)
ry = c(1629271, 1631755)
Description
Quick plot of USA project with UTM.
Usage
plotusa(USAmap, LATS=c(22,49.62741), LONS=c(229.29389,296.41803), add=FALSE)
Arguments
USAmap Map for the U.S. (from geomapdata)
LATS vector of latitude bounds
LONS vector of longitude bounds
add add to existing plot
Value
Graphical Side Effect
plotUTM 127
Author(s)
Jonathan M. Lees<[email protected]>
See Also
zebra
Examples
## Not run:
library(geomapdata)
data(package='geomapdata', "USAmap")
plotusa(USAmap)
## End(Not run)
Description
Plot UTM
Usage
plotUTM(proj, LIM, shiftlon = 0)
Arguments
proj projection
LIM Limit vector
shiftlon rotation around z axiz, default=0
Value
Graphical Side Effect
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GLOB.XY
128 plotworldmap
Examples
library(geomapdata)
data(USAmap)
## Not run:
library(geomapdata)
data(USAmap)
p = plotusa(USAmap)
plotUTM(p$PROJ, LIM=p$LIM)
## End(Not run)
Description
Usage
Arguments
MAP GEOmap structure
LIM Vector of limits c(lon1, lat1, lon2, lat2)
shiftlon Rotate map by degrees longitude (must adjust the LIM vector accordingly, see
example below)
add logical, TRUE=add to current plot
NUMB logical, add numbers to plot
PLOTALL logical, plot all strokes, do not select
Decorate logical, add UTM regional designations
... grpahical parameters from par
Value
Graphical Side Effects
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
plotGEOmap, plotGEOmapXY
Examples
library(geomapdata)
data(worldmap)
plotworldmap(worldmap)
### restrict to North Atlantic:
plotworldmap(worldmap, LIM = c(0, 0, 120, 90), shiftlon=250, PLOTALL=TRUE, Decorate=FALSE )
Description
find evenly spaced points along a line
Usage
PointsAlong(x, y, spacing = NULL, N = 1, endtol = 0.1)
130 PointsAlong
Arguments
x x-coordinates
y y-coordinates
spacing spacing of points
N number of points
endtol indent on either ends
Details
The total length is returned: this is the line integral along the trace.
Value
List:
x x-coordinates
y y-coordinates
rot angle at the points
TOT total length along the trace
Author(s)
Jonathan M. Lees<[email protected]
Examples
lines(ff$x, ff$y)
points(g$x, g$y)
polyintern 131
Description
Usage
Arguments
P Polygon,xy
n grid dimension over polygon, n by n
PLOT logical, TRUE=plot
Details
A grid is laid over the polygo, the internal points are extracted and for each one the shortest distance
to te perimeter is determined. Then the point with the largest distance is returned.
Value
x x coordinate of point
y y coordinate of point
zi index of point
nx internal grid points x
ny internal grid points y
ef internal grid points distances to perimeter
Author(s)
Jonathan M. Lees<[email protected]>
See Also
pline
132 printGEOinfo
Examples
X=list()
X$x=c(11.991,11.942,11.891,11.834,11.775,11.725,11.691,
11.712,11.746,11.804,11.865,11.957,11.991)
X$y=c(-2.0091,-2.0699,-2.0823,-2.1091,-2.1419,
-2.1394,-2.1165,-2.0604,-2.0196,-1.9847,-1.9668,-1.9777,-2.0091)
printGEOinfo printGEOinfo
Description
Usage
printGEOinfo(MAP, kstroke)
Arguments
MAP GEOmap
kstroke index to strokes
Details
Prints some of the meta data stored in the GEOmap header list, strokes.
Value
Side Effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
printGEOmap
printGEOmap 133
Examples
data(coastmap)
printGEOinfo(coastmap, 1:10)
printGEOmap printGEOmap
Description
Print information on GEOmap strokes
Usage
printGEOmap(G)
Arguments
G GEOmap
Details
Prints the full STROES list as a dataframe.
Value
Side Effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
printGEOinfo
Examples
data(coastmap)
printGEOmap(coastmap)
134 projtype
Description
List of Projection types in GEOMAP
Usage
projtype(proj=list())
Arguments
proj Projection list
Details
Just returns possile choices.
Value
Side Effects
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
setPROJ
Examples
projtype()
projtype(proj)
Description
Extract a rectangular perimeter
Usage
rectPERIM(x, y = 1, pct = 0)
Arguments
x x values or a list include x, y members
y y values, if missing, x must be a list
pct Percent expansion, based on range of x and y values. If pct>1 it is divided by
100 to get a fractional percent expansion.
Details
The rectangular box will be expanded based on the percent pct.
Value
list of x, y values from lower left corner counter clockwise around perimeter
Author(s)
Jonathan M. Lees<[email protected]>
See Also
getGEOperim
Examples
fx =rnorm(20)
fy = rnorm(20)
polygon(rp)
text(rp, labels=1:4, pos=c(1,1,3,3), font=2, cex=2)
Fx = list(x=fx2, y=fy2)
rp = rectPERIM(Fx)
polygon(rp, border='red')
polygon(rp)
polygon(rp)
Description
Find points on a rectangle closest to a set of points.
Usage
rekt2line(rekt, pnts)
Arguments
rekt rectangle comprised of 4 points in counter clockwise direction.
pnts set of points inside the rectangle
Details
Program is used for exploding symbols to the edge of the rectangle input
Value
list ofnew poistion x,y values
rose 137
Author(s)
Jonathan M. Lees<[email protected]>
See Also
ExplodeSymbols
Examples
F1 = list(x=rnorm(20), y=rnorm(20))
r1 = range(F1$x)
r2 = range(F1$y)
r1 = c(r1[1]-0.1*diff(r1), r1[2]+0.1*diff(r1))
r2 = c(r2[1]-0.1*diff(r2), r2[2]+0.1*diff(r2))
Description
Usage
Arguments
angles numeric, vector of angles in radians
bins integer, number of bins
x numeric, x location on page
y numeric, y location on page
col color for pie slices
border color for pie borders
annot logical, annotation
main character, main title
prop proportional plotting, default = 1
pts logical, add points (default=FALSE)
cex character expansion
pch plotting character
dotsep separation of dots
siz size of plot
LABS Labels
LABangle angle for plotting Label angles
add logical, add to plot (default=FALSE)
SYM logical, symmetric rose diagram (FALSE)
Details
Create a rose diagram or add rose diagram to an existing plot. Used for plotting geographic orien-
tations or directions.
Value
list:
usector sector angles
uradius sector radii
usizx x size scale
usizy y size scale
x x center on page
y y center on page
Note
For symmetric plots, bins are rotated and added together, then the reflection is made.
Author(s)
Jonathan M. Lees<[email protected]>
rotateGEOmap 139
See Also
package RFOC for distributions on a sphere
Examples
ff=c(23,27,53,58,64,83,85,88,93,99,100,
105,113,113,114,117,121,123,125,126,
126,126,127,127,128,128,129,132,132,
132,134,135,137,144,145,145,146,153,
155,155,155,157,163,165,171,172,179,181,186,190,212)
Description
Rotate a GEOmap to a new location on the globe
Usage
rotateGEOmap(INmap, TARGlat, TARGlon, LAT0, LON0, beta = 0)
Arguments
INmap Input GEOmap
TARGlat Target center latitide
TARGlon Target center longitide
LAT0 Source center latitide
LON0 Source center longitide
beta rotation through axis coming out of screen
140 rotateGEOmap
Details
This function is used to translate a given map region to another for over plotting. You can compare
the areas of two region using the same projection.
Value
GEOmap list.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
plotGEOmapXY
Examples
library(maps)
neweng = maps2GEOmap(zz)
plotGEOmap(neweng)
## L1 = locator(1)
L1=list()
L1$x=c(283.671347071854)
L1$y=c(42.008587074537)
## L2 = locator(1)
L2=list()
L2$x=c(341.146812632372)
L2$y=c(64.9180246121089)
Description
rotation about Z-axis
Usage
rotdelta4(delta)
Arguments
delta angle in degrees
Value
Matrix for rotation
Author(s)
Jonathan M. Lees<[email protected]>
See Also
roty4, rotx4, trans4
Examples
rotdelta4(23)
142 rotmat2D
Description
set a rotation matrix
Usage
rotmat2D(alph)
Arguments
alph angle in radians
Value
matrix for rotation in 2 dimensions
Author(s)
Jonathan M. Lees<[email protected]>
Examples
r1 = 0.4
r2 = 0.2
m=matrix(rep(0,2*length(theta)),ncol=2)
m[,1]=r1*cos(theta)
m[,2]=r2*sin(theta)
lines(m[,1]+.5, m[,2]+.5)
nm=m %*% R
### plot
lines(nm[,1]+.5, nm[,2]+.5, col='red')
Description
x-axis rotation matrix
Usage
rotx4(vec)
Arguments
vec vector of direction cosines
Details
Length of vector cannot be zero.
Value
Matrix for rotation
Author(s)
Jonathan M. Lees<[email protected]>
See Also
roty4, rotdelta4
Examples
v = c(12,13,-4)
rotx4(v)
144 roty4
Description
Usage
roty4(vec)
Arguments
Details
Value
Author(s)
Jonathan M. Lees<[email protected]>
References
See Also
rotx4, rotdelta4
Examples
v = c(12,13,-4)
roty4(v)
SELGEOmap 145
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)
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.
Value
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
146 setMarkup
Author(s)
Jonathan M. Lees<[email protected]>
See Also
geoarea
Examples
library(geomapdata)
data(worldmap)
skam = SELGEOmap(worldmap, ncut=3, acut=c(10000, Inf), proj=NULL, LIM=NULL)
par(mfrow=c(2,1))
#####################
#####################
Description
Interactive set up of mark of labels for a map
Usage
setMarkup(LABS = NULL, PROJ = NULL)
Arguments
LABS vector of labels
PROJ projection structure
Details
labels are set one-by-one and the user inout relevant information like locator() and other features
Value
List of Markup information
setplotmat 147
Author(s)
Jonathan M. Lees<[email protected]>
See Also
Markup
Examples
## Not run:
MUP = setMarkup(LABS)
## End(Not run)
Description
set up matrices for selecting from eTOPO5
Usage
setplotmat(x, y)
Arguments
x vector of lons
y vector of lats
Details
For extracting from ETOPO5 and ETOPO2, used internally in DOTOPOMAPI
Value
list(x=EX, y=WHY)
148 SETPOLIMAP
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
DOTOPOMAPI
Examples
PLOC= list(LON=c(138.3152, 139.0214),
LAT=c(35.09047, 35.57324))
G = setplotmat(ax,ay)
Description
Divides world into continents.
Usage
SETPOLIMAP()
Details
Used for CIA data base
Value
Returns GEOmap list of continents
STROKES list(nam, num, index, col, style, code, LAT1, LAT2, LON1, LON2)
POINTS list(lat, lon)
PROJ list(type, LAT0, LON0, LAT1, LAT2, LATS, LONS, DLAT, DLON, FE, FN,
name)
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
selectPOLImap
setPROJ 149
Examples
LMAP = SETPOLIMAP()
Description
Setup parameters for Map Projection
Usage
setPROJ(type = 1, LAT0 = 0, LON0 = 0, LAT1 = 0, LAT2 = 0, LATS = NULL,
LONS = NULL, DLAT = NULL, DLON = NULL, FE = 0, FN = 0, IDATUM=1)
Arguments
type Type of projection
LAT0 Central Latitude
LON0 Central Longitude
LAT1 Latitude parameter for special projection, where needed
LAT2 Latitude parameter for special projection, where needed
LATS vector of range of Latitudes
LONS vector of range of Longitudes
DLAT difference of Lats
DLON difference of Lons
FE False Easting
FN False Northing
IDATUM integer, index to the datum database
Details
Set up for the various projections used by GEOmap
Value
List of values described above
Note
Some of the parameters are not critical to all the choices or Map Projection. In that case they are
set to defaults and ignored by that projection.
LONs are modified and rectified by fmod function.
The datum data base is accesses via the function DATUMinfo. There are 11 different projection
datums. These are NAD83/WGS84, GRS 80, WGS72, Australian 1965, Krasovsky 1940, Interna-
tional (1924) -Hayford (1909), Clake 1880, Clarke 1866, Airy 1830, Bessel 1841, Everest 1830.
150 settopocol
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
projtype, XY.GLOB, GLOB.XY, DATUMinfo
Examples
###### type
projtype()
###### type = mercator spherical
setPROJ(type = 1, LAT0 =23, LON0 = 35)
### No Projection
setPROJ(type = 0, LAT0 =23, LON0 = 35)
Description
Set up vectors and structures for creating a color map for topographic plots
Usage
settopocol()
sizelegend 151
Details
RGB Colors are defined for topographic elevations and/or depths. The basic data is stored as z1
red1 green1 blue1 z2 red2 green2 blue2 and linear interpolation is used between elevations. The
color set here extends from green in lowlands around sealevel through browns and light-browns
through to whites at snow covered peaks.
Value
LIST:calcol=calcol , coltab=coltab
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
Examples
settopocol()
Description
Plot a simple legend of magnitude sizes at the top of a plot.
Usage
sizelegend(se, am, pch = pch)
Arguments
se vector, sizes
am vector, labels
pch plotting character
Details
A box around the legend is currently introduced.
Value
Graphical Side Effect
152 sqrTICXY
Author(s)
Jonathan M. Lees<[email protected]>
Examples
x = rnorm(30)
y = rnorm(30)
plot(x, y, type="n")
esiz = exp(mags)
rsiz = RPMG::RESCALE(esiz, .4, 10, min(esiz), max(esiz))
points(x, y, pch=1, cex=rsiz)
am = pretty(mags)
am = am[am>min(mags) & am<max(mags) ]
em = exp(am)
se = RPMG::RESCALE(em, .4, 10, min(esiz), max(esiz))
Description
Lat-Lon Tick marks and grid for Square plot
Usage
sqrTICXY(prsurf, proj, side = c(1, 2, 3, 4), PMAT=NULL, LLgrid = TRUE,
col = "black", colt = "black", font=5, cex=1, lty=2, lwd=1,
pcex=1, TICS=NULL)
Arguments
prsurf list with x, y
proj projection
side vector, which sides to plot, 1=bottom, 2=left, 3=top, 4=right
sqrTICXY 153
Value
Graphical side effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
addLLXY, plotGEOmapXY
Examples
Description
Plot a strike slip fault
Usage
SSfault(x, y, h = 1, hoff = 0.15, rot = list(cs = 1, sn = 0),
col = "black", dextral = TRUE, lwd = 1)
Arguments
x x-coordinates
y y-coordinates
h length of symbol
hoff distance from line
rot rotation list
col color
dextral logical, TRUE=dextral polarity
lwd line width
Details
Rotation vector is provided as list(cs=vector(), sn=vector()).
Value
Graphical Side effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
GEOsymbols
STROKEinfo 155
Examples
G=list()
G$x=c(-1.0960,-0.9942,-0.8909,-0.7846,-0.6738,-0.5570,-0.4657,-0.3709,
-0.2734,-0.1740,-0.0734, 0.0246, 0.1218, 0.2169, 0.3086, 0.3956, 0.4641,
0.5293, 0.5919, 0.6530, 0.7131)
G$y=c(-0.72392,-0.62145,-0.52135,-0.42599,-0.33774,-0.25896,-0.20759,
-0.16160,-0.11981,-0.08105,-0.04414,-0.00885, 0.02774, 0.06759, 0.11262,
0.16480, 0.21487, 0.27001, 0.32895, 0.39044, 0.45319)
lines(G$x,G$y,col='blue')
Description
print stroke information from a GEOmap data base
Usage
STROKEinfo(map, w = 1, h = NULL)
Arguments
map GEOmap data list
w which strokes to extract, vector of number indices or single string to match
names in data base list
h numeric vector of columns of data base, or vector of characters to match names.
156 subsetTOPO
Details
Uses grep to match names so can have short names
Value
data.frame of extracted strokes
Note
Use gsub to change the names of strokes.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
gsub
Examples
data(coastmap)
STROKEinfo(coastmap, h="nam", w="Indo")
Description
Extract a subset of a topo DEM
Usage
subsetTOPO(TOPO, ALOC, PROJ, nx=500, ny=500, nb = 4, mb = 4, hb = 8)
Arguments
TOPO DEM list including x,y,z
ALOC list including LAT LON vectors for extracting an array from the DEM
PROJ projection
nx number of points in x grid, default=500
ny number of points in y grid, default=500
subsetTOPO 157
Details
Value
x vector x-coordinates
y vector y-coordinates
z 2D matrix of elevations
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
GEOTOPO
Examples
## Not run:
#### first install the ETOPO5 data package
library(geomapdata)
load(ETOPO5)
## data(ETOPO5)
PLOC=list(LON=c(137.008, 141.000),LAT=c(34.000, 36.992),
x=c(137.008, 141.000), y=c(34.000, 36.992) )
## End(Not run)
158 SynAnticline
Description
Usage
Arguments
x x-coordinates
y y-coordinates
syn logical, TRUE=syncline, FALSE=anticline
spacing spacing of points
N number of points
r1 x-radius of curled part
r2 y-radius of curled part
h1 length of first leg
h2 length of 2nd leg
endtol indent on either ends
REV reverse direction of x-y
col color of teeth and line
... graphical parameters
Value
Author(s)
Jonathan M. Lees<[email protected]
See Also
PointsAlong
targetLL 159
Examples
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
######## anticline
plot(c(-5,5), c(-5,5), asp=1, type='n' )
######## syncline
plot(c(-5,5), c(-5,5), asp=1, type='n' )
SynAnticline(G$x,G$y, N=5, syn=FALSE, endtol=.2)
Description
Get a target Lat-Lon from a set of Lat-Lon pairs
Usage
targetLL(sta, rdist = 100)
Arguments
sta station list (with slots lat lon)
rdist radius in km
Details
Uses the Median station as the center and returns the lat-lon extents of the target region.
Value
list(
Author(s)
Jonathan M. Lees<[email protected]>
Examples
Description
Usage
Arguments
x x-coordinates
y y coordinates
h height of tooth
rot rotation of teeth
col color of line
border color of border, default= col
Details
Value
Author(s)
Jonathan M. Lees<[email protected]
See Also
thrust
Examples
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
lines(ff)
points(ff)
Description
Add Thrust fault with teeth on overlying block
Usage
thrust(x, y, h = 1, N=1, REV = FALSE, endtol=0.1, col = "black", ...)
Arguments
x x-coordinates
y y-coordinates
h height of teeth
N NUmber of points along line
endtol percent tolerance on ends of line
REV reverse direction of x-y (teeth on other side)
col color of teeth and line
... graphical parameters
Value
Graphical Side effect
Author(s)
Jonathan M. Lees<[email protected]
See Also
teeth
Examples
plot(c(-5,5), c(-5,5), asp=1, type='n' )
ff=list()
ff$x=c(-4.850,-4.700,-3.934,-2.528, 0.603, 2.647, 3.861, 2.626)
ff$y=c(-4.045,-2.087,-0.710, 0.172, 1.291, 2.087,-0.753,-4.131)
###
Description
Usage
TOPOCOL(IZ, calcol)
Arguments
IZ Matrix of values
calcol Color mapping of elevations to rgb colors
Details
Value
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
See Also
persp
164 TOPOCOL
Examples
colk1 = 50
colk2 = 210
colk3 = 220
colk4 = 250
BWpal2 = list(z1=c(-3000, 0, 2000, 3500),
r1=c(0,colk1, colk3, colk4),
g1=c(0,colk1, colk3, colk4),
b1=c(0,colk1, colk3, colk4),
z2=c(0, 2000, 3500, 5000),
r2=c(0,colk2,colk4,255),
g2=c(0,colk2,colk4,255),
b2=c(0,colk2,colk4,255),
note=c("black, black", "grey, grey", "white, white", "white, white")
)
data(volcano)
calcol=settopocol()
MYCOLL = TOPOCOL(volcano, calcol$calcol)
K <- 8 *volcano
Description
Usage
trans4(vec)
Arguments
vec 3 vector
Value
4 by 4 matrix
Author(s)
Jonathan M. Lees<[email protected]>
References
See Also
Examples
trans4(c(0,0,0))
166 UTM.ll
Description
UTM Map projection parameters supplied and X-Y, return the LAT-LON values, WGS-84
Usage
UTM.ll(x , y , PROJ.DATA)
utm.wgs84.ll(x , y , PROJ.DATA)
Arguments
x x
y y
PROJ.DATA list of projection parameters
Value
List
phi Latitude-coordinate
lam Longitude-coordinate
Note
When calling the conversion from LL to XY or vice versa, convert the lon to 0 to 360. Use
RPMG::fmod for this conversion. This may be rectified in future revisions.
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder
See Also
Examples
lat = 40.5
lon = -73.50
LON = RPMG::fmod(lon, 360)
### wgs84
wproj1 = setPROJ(type = 8, LAT0 = 0 , LON0 = lon0 , IDATUM=1)
uu = UTM.xy(lat,LON , wproj1)
Description
Using Map projection parameters supplied and X-Y, return the LAT-LON values
Usage
utm.sphr.ll(x , y , PROJ.DATA)
Arguments
x x
y y
PROJ.DATA list of projection parameters
Value
List
phi Latitude-coordinate
lam Longitude-coordinate
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
168 utm.sphr.xy
References
Snyder
See Also
GLOB.XY, setPROJ
Description
Using Map projection parameters supplied and LAT-LON, return the x-y values
Usage
utm.sphr.xy(phi, lam, PROJ.DATA)
Arguments
phi Latitude
lam Longitude
PROJ.DATA list of projection parameters
Value
List
x x-coordinate
y y-coordinate
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder
See Also
GLOB.XY, setPROJ
UTM.xy 169
Description
UTM Map projection parameters supplied and LAT-LON, return the x-y values, WGS-84 datum
Usage
Arguments
phideg Latitude
lamdeg Longitude
PROJ.DATA list of projection parameters
Value
List
x x-coordinate
y y-coordinate
Note
When calling the conversion from LL to XY or vice versa, convert the lon to 0 to 360. Use
RPMG::fmod for this conversion. This may be rectified in future revisions.
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, J. P., 1987; Map Projections - A Working Manual. U.S. Geological Survey Professional
Paper 1395, 383 p.
See Also
Examples
lat = 40.5
lon = -73.50
lon0 = -75
LON = RPMG::fmod(lon, 360)
lon0 = uzone$CEN[2]
wproj = setPROJ(type = 5, LAT0 = 0 , LON0 = lon0 , FE = 500000 )
utm.elps.xy(lat, LON,wproj )
Description
Get UTM Box info
Usage
utmbox(lat, lon)
Arguments
lat latitude
lon longitude
UTMzone 171
Value
List:
lon input point longitude
lat input point latitude
LON LL corner longitude
LAT LL corner latitude
utmbox List: x=utm number, y=utm letter
UTM0 List: center of box: lam=long, phi=lat
Author(s)
Jonathan M. Lees<[email protected]>
See Also
plotUTM
Examples
lat = 35.76658
lon = 279.4335
utmbox(lat, lon)
Description
Return the UTM zone information
Usage
UTMzone(lat, lon = NA)
Arguments
lat latitude
lon longitude
Details
The function works two ways: If the lat-lon are numeric and lon is not NA then the UTM zone
information is returned. If lon is NA and lat is one of the UTM zones, then the lat-lon information
for that zone is returned.
172 X.prod
Value
list:
Author(s)
Jonathan M. Lees<[email protected]>
See Also
setPROJ, UTM.xy, UTM.ll, DATUMinfo
Examples
lat = 40.5
lon = -73.50
UTMzone(lat, lon)
## or
UTMzone("18T")
Description
Vector Cross Product for spatial cartesian vectors
Usage
X.prod(a, b)
Arguments
a 3-vector
b 3-vector
Value
3-vector
Author(s)
Jonathan M. Lees<[email protected]>
XSECDEMg 173
Examples
v1 = c(1,1,1)
v2= c(-1, -1, 1)
X.prod(v1, v2)
Description
This function Takes a Digital Elevation Map (or any surface) and illustrates how to take interactive
cross sections with RPMG through the surface.
Usage
XSECDEMg(Data, labs=NULL, pts=NULL, nlevels=10, demo=FALSE)
Arguments
Data Structure with x, y, z components, typical of contoured surfaces or digital images
labs Vector of labels for Buttons used in the RPMG
pts Points to plot on map view
nlevels Number of levels for contours
demo Argument used to turn off interactive part. Default is FALSE, but for package
construction is set to TRUE so no interaction is required.
Details
XSECDEMg is an example stub illustrating the use of RPMG. The idea is to set up a while() loop
that uses input from the locator() function to execute or analyze data depending on user defined
buttons. Actions are executed when the button clicked matches the list of names provided by the
user.
Value
No return values
Note
This code is designed as an example of how to set up a Really Poor Man’s GUI. The demo argument
is supplied so that this code will run without user input, as when creating a checks for package
construction.
174 XSECEQ
Author(s)
Jonathan M. Lees <[email protected]>
See Also
whichbutt, rowBUTTONS
Examples
data(volcano)
attr(volcano, 'dx') =10
attr(volcano, 'dy') =10
mybutts = c("DONE", "REFRESH", "rainbow", "topo", "terrain", "CONT",
"XSEC","PS" )
### in the following change demo=FALSE to get interactive behavior
XSECDEMg(volcano, mybutts, demo=TRUE)
Description
Iinteractive earthquake cross section
Usage
XSECEQ(MAP, EQ, XSECS = NULL, labs = c("DONE", "REFRESH", "XSEC",
"MSEC"),
width = 10, kmaxes = TRUE, pch = ".", demo = FALSE, png=FALSE )
Arguments
MAP Geologic Map Structure
EQ list of earthquakes
XSECS list of cross sections
labs labels for cross sections
width width of swaths
kmaxes logical, TRUE=keep all cross sections same depth
pch plotting character
demo Logical, TRUE=not-interactive
png Logical, TRUE=create png files of the cross sections
XSECEQ 175
Value
Graphical side effects and creates cross-sectional swaths returned as a list, see eqswath for list
structure.
Author(s)
Jonathan M. Lees<[email protected]>
See Also
XSECDEM, eqswath, XSECwin
Examples
## Not run:
MAP[[2]] = japmap
EQ =list()
EQ[[1]]=list(lat=EHB.LLZ$lat[flagEHB], lon=EHB.LLZ$lon[flagEHB] ,
x=eqJ$x, y=eqJ$y, z=EHB.LLZ$z[flagEHB], col="brown", pch=".", cex=1.5)
rz = NULL
for(i in 1:length(EQ))
{
176 XSECwin
for(i in 1:length(EQ))
{
iz = RPMG::RESCALE(EQ[[i]]$z, 1, 100, rz[1], rz[2])
EQ[[i]]$COL = rainbow(100)[iz]
}
data(NSWath)
NSWath2 = XSECEQ( MAP, EQ ,XSECS=NSWath, labs, width=30, demo=TRUE )
## End(Not run)
Description
Cross section of earthquakes.
Usage
XSECwin(SW, iseclab = 1, xLAB = "A",
labs = c("DONE", "REFRESH", "PS"), width = 10, demo = FALSE)
Arguments
SW list of swath data
iseclab section number
xLAB Label
labs labels
width width of swath
demo logical, TRUE=not interactive
Details
Called by XSECEQ; but this can be run independantly if plots are needed after interactive process-
ing.
XSECwin 177
Value
Graphical Side effects
Author(s)
Jonathan M. Lees<[email protected]>
See Also
eqswath, XSECEQ
Examples
## Not run:
library(geomapdata)
data('japmap', package='geomapdata' )
proj = setPROJ(type = 2, LAT0=35.358,LON0=138.731)
MAP[[2]] = japmap
EQ =list()
EQ[[1]]=list(lat=EHB.LLZ$lat[flagEHB], lon=EHB.LLZ$lon[flagEHB] ,
x=eqJ$x, y=eqJ$y, z=EHB.LLZ$z[flagEHB], col="brown", pch=".", cex=1.5)
rz = NULL
for(i in 1:length(EQ))
{
rz = range(c(rz, EQ[[1]]$z), na.rm=TRUE )
178 XY.GLOB
for(i in 1:length(EQ))
{
iz = RPMG::RESCALE(EQ[[i]]$z, 1, 100, rz[1], rz[2])
EQ[[i]]$COL = rainbow(100)[iz]
}
## dev.new()
LAB = attr(NSWath[[i]], "LAB")
## End(Not run)
Description
Convert from XY to GLOBAL LAT-LON
Usage
XY.GLOB(x, y, PROJ.DATA)
Arguments
x X in whatever units
y Y in whatever units
PROJ.DATA Projection list
Details
Units are whatever is returned from the projection definition. This is the inverse of GLOB.XY.
xyz2ll 179
Value
If it is a LIST, use
lat Latitude
lon Longitude
...
Author(s)
Jonathan M. Lees<jonathan.lees.edu>
References
Snyder, John P., Map Projections- a working manual, USGS, Professional Paper, 1987.
See Also
setPROJ
Examples
Description
Cartesian to Lat-Lon
Usage
xyz2ll(x)
Arguments
x 3-vector
Details
Returns Latitude not Co-latitude
180 zebra
Value
2-vector of lat-lon
Note
Does only one point at a time
Author(s)
Jonathan M. Lees<[email protected]>
See Also
Lxyz2ll
Examples
xyz2ll(c(1,1,1) )
Description
Plot a zebra style horizontal scale on a projected map.
Usage
zebra(x, y, Dx, dx, dy, lab = "", pos=1, col = c("black", "white"),
cex = 1, textcol="black", xpd=TRUE, PMAT = NULL)
Arguments
x x-coordinate of left corner
y y-coordinate of left corner
Dx distance in x, km
dx distance for zebra stripes in x
dy thickness in km
lab labels
pos position of text, 1=below, 3=above, as in par
col 2-vector of colors, for the alternating bars
cex character expansion
textcol color for the text
xpd logical, graphic parameter for clipping (see par)
PMAT 3D projection matrix from persp
zebra 181
Details
Plots a zebra style kilometer scale on the current plot
Value
Graphical Side effect
Author(s)
Jonathan M. Lees<[email protected]>
Examples
library(geomapdata)
data(USAmap)
USALL=list()
USALL$lat=c(24.72853,49.62741)
USALL$lon=c(229.29389,296.41803)
## set UTM projection
PROJ = setPROJ(type = 2, LAT0 =mean(USALL$lat), LON0 = mean(USALL$lon) )
zeb=list()
zeb$x=c(197.727896066)
zeb$y=c(-1155.81158234)
∗ aplot BASICTOPOMAP, 12
addLLXY, 6 boundGEOmap, 16
addTIX, 8 CCcheck, 17
antipolygon, 10 ccw, 18
bcars, 14 darc, 25
ColorScale, 20 DATUMinfo, 26
faultdip, 42 demcmap, 27
faultperp, 43 difflon, 27
GEOsymbols, 55 distaz, 28
horseshoe, 75 dms, 30
linesGEOmapXY, 88 DUMPLOC, 31
normalfault, 108 Ellipsoidal.Distance, 32
OverTurned, 113 eqswath, 36
perpen, 115 ExcludeGEOmap, 37
pgon, 116 expandbound, 38
SynAnticline, 158 explode, 39
teeth, 160 ExplodeSymbols, 40
thrust, 162 fixCoastwrap, 44
zebra, 180 gclc, 45
∗ datasets geoarea, 46
coastmap, 19 geoLEGEND, 47
EHB.LLZ, 32 GEOmap.breakline, 50
NSWath, 111 GEOmap.breakpoly, 50
∗ hplot GEOmap.cat, 51
GEOTOPO, 56 GEOmap.CombineStrokes, 52
plotGEOmap, 118 GEOmap.Extract, 53
plotGEOmapXY, 120 GEOmap.list, 54
plotusa, 126 GEOTOPO, 56
plotworldmap, 128 getETOPO, 58
XSECEQ, 174 getGEOmap, 59
XSECwin, 176 getGEOperim, 61
∗ iplot getgreatarc, 62
GETXprofile, 67 getmagsize, 63
locworld, 95 getnicetix, 64
XSECDEMg, 173 getspline, 65
XSECEQ, 174 getsplineG, 66
XSECwin, 176 GLOB.XY, 68
∗ misc GLOBE.ORTH, 69
along.great, 9 GlobeView, 72
182
INDEX 183
SELGEOmap, 145
setMarkup, 146
setplotmat, 147
SETPOLIMAP, 148
setPROJ, 149
settopocol, 150
sizelegend, 151
sqrTICXY, 152
SSfault, 154
stereo.sphr.ll (utm.sphr.ll), 167
stereo.sphr.xy (utm.sphr.xy), 168
STROKEinfo, 155
subsetTOPO, 156
SynAnticline, 158
targetLL, 159
teeth, 160
textGEOmapXY (linesGEOmapXY), 88
thrust, 162
TOPOCOL, 163
trans4, 165