-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaddbikeparking.R
61 lines (45 loc) · 1.54 KB
/
addbikeparking.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# allows us to add a new bike parking spot
library(tidyverse)
library(mapboxapi)
newaddress <- "23961 WA-3, Belfair, WA 98528"
newname <-"SAFEWAY BELFAIR"
newimage <- "Safeway Belfair.jpg" # NA if none
newdesc <- "To the left of entrance by Devita"
newvariant <- "OTHER" #VARIANT GRID WAVE BOLLARD STAPLE CUSTOM
newcovered <- "YES" #YESNO
newspaces <- 4 # number
# read it in
bikeparking <- read_csv("~/Documents/kitsap-bike-parking/kitsap-bike-parking.csv")
# add the stuff
bikeparking <- bikeparking %>%
add_row(NAME = newname,
ADDRESS = newaddress,
DESC = newdesc,
VARIANT = newvariant,
COVERED = newcovered,
SPACES = newspaces,
IMG = newimage,
LNG = mb_geocode(newaddress)[1],
LAT = mb_geocode(newaddress)[2]
)
write_csv(bikeparking, file="~/Documents/kitsap-bike-parking/kitsap-bike-parking.csv")
bikeparking %>%
group_by(COVERED) %>%
summarize(SPACES = sum(SPACES))
# mapbox_map <- leaflet() %>%
# addMapboxTiles(style_id = "light-v9",
# username = "mapbox") %>%
# setView(lng = -122.6413,
# lat = 47.6477,
# zoom = 11)
#
# mapbox_map %>%
# leaflet() %>%
# setView(lng = -122.6413,
# lat = 47.6477,
# zoom = 11)%>%
# addTiles() %>%
# addCircleMarkers(data = bikeparking, lng = ~LNG, lat = ~LAT, color = "#301934",
# label = ~NAME, radius = 7, fillOpacity = 0.7, fillColor = "#D8BFD8")
#markerOptions(interactive = FALSE))
#labelOptions(noHide = TRUE, permanent = TRUE))