Shapefile(s) to vector tile set
graph LR
A[Vector source - eg. shapefile] --> |ogr2ogr| B[geoJSON]
B --> |tippecanoe| C[Set of .pbf tiles]| get_factor_values <- . %>% | |
| summarise(across( | |
| where(is.factor), | |
| list( | |
| n = ~ length(levels(.x)), | |
| # could also pivot longer so that there's a row for each level... | |
| pos_values = ~ paste(levels(.x), collapse = "|")), | |
| .names = "{.col}-{.fn}" | |
| )) %>% | |
| pivot_longer(everything(), names_to = c("col_name", ".value"), |
| library(tidyverse) | |
| library(ggiraph) | |
| library(ggflags) | |
| library(gfonts) | |
| library(here) | |
| mydata <- tribble( | |
| ~ x, ~ y, ~ flag, ~ is_home, | |
| 1, 1, "au", "yes", | |
| 2, 2, "us", "no", |
| # in hindsight i probably should've used a network analysis package to do this | |
| library(tidyverse) | |
| set.seed(1) | |
| # create a sample data frame of origins and destinations | |
| testdf <- | |
| tibble( | |
| origin = sample(letters, 10), | |
| destination = sample(letters, 10), |
| library(sf) | |
| library(httr2) | |
| library(ggplot2) | |
| # based on https://community.esri.com/t5/gis-blog/ | |
| # accessing-arcgis-rest-services-using-r/ba-p/898451 | |
| api_query <- url_parse("https://geo.abs.gov.au") | |
| api_root <- "/arcgis/rest/services" |
lib/model.dart:
getPrediction: calls the predict methodgetImagePrediction: calls the predictImage method and then compares the maximum score agains tthe label listgetImagePredictionList: calls the predictImage method, returns all scoresandroid/src/main/java/io/funn/pytroch_mobile/PyTorchMobilePlugin.java:
| project: | |
| type: website |
In Svelte:
<FileName>. wrap them in a parent div.position: relative and the map layers position: absolute; top: 0; left: 0;. use :global([selector]) to inject the styles into the svgs| my_func <- function(alpha, beta, gamma) alpha + beta + gamma | |
| # no | |
| tibble(a = 1:5, b = 6:10, c = 11:15) %>% | |
| mutate(z = pmap_int(., my_func)) | |
| # yes | |
| tibble(a = 1:5, b = 6:10, c = 11:15) %>% | |
| mutate(z = pmap_int( | |
| dplyr::select(., alpha = a, beta = b, gamma = c), |
| gdp <- data.frame( | |
| name = c("us", "cn", "jp", "de", "in", "gb", "fr", "it", "ca"), | |
| gdp = c(26854, 19374, 4410, 4309, 3740, 3160, 2924, 2170, 2090), | |
| x = c(1,2,3,1,2,3,1,2,3), | |
| y = c(3,3,3,2,2,2,1,1,1)) | |
| p1 <- ggplot(gdp) + | |
| aes(x, y) + | |
| geom_flag(aes(country = name, size= gdp)) + |