map_rides: plot ride track data on a map

Description Usage Arguments Details Value

View source: R/gps_visuals.R

Description

map_rides Plot lat/long data on maps, optionally using colored dots to indicate speed

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
map_rides(geodf, outfile, maptitle, definedmaps, usemap,
  rasterDir = NULL, plotly = FALSE, rgl = FALSE,
  localElevFile = "", plot3DSize = 300, plot3DVertScale = 1,
  trackCurveElevFromRaster = FALSE, trackCurveHeight = 15,
  res3d = 3000, featureDataSource = "none", townLevel = 3,
  roadLevel = 4, waterALevel = 4, waterLLevel = 5,
  rglColorScheme = "default", useImageRaster = FALSE,
  rglColorMaxElev = 3000, rglShininess = 0,
  rglLightPars = "viewpoint.rel=TRUE", rglLights = TRUE,
  maptype = "osm", minTiles = 50, mapsize = c(1600, 1200),
  fine.map = FALSE, margin.factor = 0.08, draw.speed = FALSE,
  line.color = "magenta", line.width = 3, line.alpha = 0.8,
  speed.color = "speedcolors", speed.alpha = 0.7, speed.ptsize = 6,
  speed.pch = 19, jpeg.quality = 90)

Arguments

geodf

data frame or tibble containing at least: position_lat.dd, position_lon.dd,(or lat,lon)(both numeric,decimal degrees), startbutton.date(int),startbutton.time(int),segment(numeric), and speed.m.s for speed coloring

outfile

name of output file, extension is either .tiff or .jpg

maptitle

string containing title

definedmaps

list, each named entry is a list of two vectors of length two, named lat and lon, containing the min and max of the latitude andf longitude of the map area

usemap

string identifying area from list definedmaps or

rasterDir

character location of base directory to load and save raster files

plotly

use plotly to draw 3D track in viewer

rgl

use rgl openGL to draw 3D track in viewer

localElevFile

file containing raster object with elevations on lat/lon

plot3DSize

number which is rough target for size of grid for plotly

plot3DVertScale

number which will multiply vertical scaling for plotly/rgl

trackCurveElevFromRaster

logical, see help for draw3dMap

trackCurveHeight

numeric, see help for draw3dMap

res3d

integer, see help for draw3dMap

featureDataSource

character, "Raster" to load saved raster data from directory specified , "none" to show none

townLevel

numeric, display towns ranked this number or higher: 3=all towns 5=larger towns (in US >50k)

roadLevel

numeric, display roads ranked this number or higher: 2=Service Drive, Bike Path, etc 3=Local Street 4=Secondary Hwy 5=Primary Hwy/Transit

waterALevel

numeric, display areal water ranked this number or higher: 2=res/treatmentpond/pit/quarry 3=lake/pond/swamp/stream 4=class 2 or 3 bigger than 1k ha 5=named lake/pond/swamp/stream 6=large lake/pond/swamp/stream 7=Ocean/Bay/Est/Sound 8=glacier

waterLLevel

numeric, display linear water ranked this number or higher: 2=canal/ditch 3=braided stream 4=stream/river 5=named stream/river 6=named stream/river containing the string "RIV"

rglColorScheme

name of color scheme from c("default","beach","viridis","plasma","terrain","oleron","snow","oslo", "desert","lajolla","niccoli","bright", "bing","maptoolkit-topo","nps","apple-iphoto")

useImageRaster

logical, use the image raster from saved openStreetmap colrings of the map surface

rglColorMaxElev

the upper limit of elevation, anything above this will be colored the same in the rgl

rglShininess

number controlling surface shininess in rgl rendering

rglLightPars

string containing parameters for rgl.light call

rglLights

logical indicating whether to turn on lighting

maptype

map to use as background ("maptoolkit-topo" or "bing" or "osm" or "stamen-terrain" or "esri-topo" or "stamen-watercolor" or "mapbox" or "esri" or "osm-public-transport" or "opencyclemap" or "apple-iphoto" or "skobbler")

minTiles

minimum number of tiles fetched for map, larger is slower but better quality

mapsize

pixel size of map created

fine.map

if true, use c(7680,4800) for map size

margin.factor

percentage to expand map area beyond limits of the track in each direction, when autodetermining region to plot

draw.speed

if true, draw track(s) as a series of points whose color indicates travel speed

line.color

the color to draw the lines of the tracks, if a palette is specified ("plasma" or "viridis" or "rainbow" or "heat" or "red-blue")is specified, each track supplied will be assigned a color from that palette

line.width

the width of the line for the tracks

line.alpha

the opacity of the line

speed.color

palette to use to represent speed on plot ("speedcolors" or "red-blue-green" or "rainbow" or "plasma" or "magma" or "heat" )

speed.alpha

opacity of the speed line if speed.color specified

speed.ptsize

size for the symbols used to plot the speed line, doubled if fine.map is set true.

speed.pch

the character to use plotting the points of the speed line

jpeg.quality

the "quality" of the JPEG image, a percentage. Smaller values will give more compression but also more degradation of the image

Details

Create a map displaying the tracks specified. Tracks may be drawn all in one specified color, with each separate track drawn in a different color from a specified palette, or as a series of closely spaced dots (which may be prodded into appearing as a line through judicious choice of point size and alpha) with the color varying based on speed and the chosen palette.

Value

NULL or plotly object


CraigMohn/bikeCadHr documentation built on Sept. 27, 2018, 2:15 p.m.