Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

commit-message.txt

  • Loading branch information...
commit 8533b5fdfc22ce3f62308f4d45169b3b76a78e77 1 parent 51b0066
@mollietaylor authored
View
BIN  Maps/auto.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Maps/default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Maps/last-month.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
34 functions.R
@@ -53,4 +53,36 @@ appendTrack <- function(filenames) {
}
}
-}
+}
+
+mapSpecs <- function(tracks, rangeConst) {
+ meanLon <- mean(allTracks$Longitude,
+ na.rm = TRUE)
+ meanLat <- mean(allTracks$Latitude,
+ na.rm = TRUE)
+ lonHiRange <- quantile(allTracks$Longitude,
+ probs = c(1 - rangeConst),
+ na.rm = TRUE)
+ lonLoRange <- quantile(allTracks$Longitude,
+ probs = c(rangeConst),
+ na.rm = TRUE)
+ lonRange <- lonHiRange - lonLoRange
+ latHiRange <- quantile(allTracks$Latitude,
+ probs = c(1 - rangeConst),
+ na.rm = TRUE)
+ latLoRange <- quantile(allTracks$Latitude,
+ probs = c(rangeConst),
+ na.rm = TRUE)
+ latRange <- latHiRange - latLoRange
+ # lonRange <- range(allTracks$Longitude)[2] - range(allTracks$Longitude)[1]
+ # latRange <- range(allTracks$Latitude)[2] - range(allTracks$Latitude)[1]
+
+ mapWidth <- max(lonRange, latRange)
+ mapZoom <- floor(13 - log2(10 * mapWidth))
+
+ return(data.frame(meanLon, meanLat,
+ lonHiRange, lonLoRange, latHiRange, latLoRange,
+ mapZoom))
+}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.