-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobal.R
More file actions
32 lines (26 loc) · 913 Bytes
/
global.R
File metadata and controls
32 lines (26 loc) · 913 Bytes
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
library(duckdb)
library(bcrypt)
library(duckdb)
library(stringr)
library(mapgl)
library(dplyr)
library(dbplyr)
library(tidyr)
library(purrr)
library(RPostgreSQL)
library(sf)
library(lwgeom)
library(rpostgis)
source("add_location.R")
source("show_locations.R")
load("osmdata_splitted.RData")
options(shiny.maxRequestSize=100*1024^2)
drv <- dbDriver("PostgreSQL")
users <- dbConnect(drv, dbname = "users", host = "db", port = 5432, user = "data_platform", password = Sys.getenv("POSTGRES_data_platform_PW"))
content <- dbConnect(drv, dbname = "content", host = "db", port = 5432, user = "data_platform", password = Sys.getenv("POSTGRES_data_platform_PW"))
azimuth_to_direction <- function(azimuth) {
directions <- c("N", "NNO", "NO", "ONO", "O", "OSO", "SO", "SSO",
"S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW")
index <- round(azimuth / 22.5) %% 16 + 1
return(directions[index])
}