Convert notebook to presentation:
jupyter nbconvert slideshow.ipynb --to slides --post serve
yarn develop
Start Strapi in watch mode.
yarn start
echo [email protected] > ~/.qmail
The OSRM docker quick start provides a great explanation on how to set up the container: https://hub.docker.com/r/osrm/osrm-backend/
Yet - for Docker on Windows minor changes were necessary for me (otherwise I'd get "File not found" or "Permission" errors).
This is how it worked for me:
| library(sf) | |
| xmin <- -2.3743 | |
| xmax <- 0.5589 | |
| ymin <- 37.3397 | |
| ymax <- 40.8679 | |
| st_polygon(list(rbind( | |
| c(xmin, ymin), | |
| c(xmin, ymax), |
| import numpy as np | |
| import geopandas as gpd | |
| import cv2 | |
| # read in data | |
| example = gpd.read_file("data/example.gpkg") | |
| scenario1 = gpd.read_file("data/example_similar.gpkg") | |
| scenario2 = gpd.read_file("data/example_different.gpkg") | |
| def signature_opt1(gdf, crs): |
| from haversine import haversine, Unit | |
| # construct the cost matrix | |
| def get_cost_matrix(gdf1, gdf2): | |
| gdf1_centroids = gdf1.to_crs(3395).centroid.to_crs(4326) | |
| gdf2_centroids = gdf2.to_crs(3395).centroid.to_crs(4326) | |
| coords_sig1 = list(zip(gdf1_centroids.y, gdf1_centroids.x)) | |
| coords_sig2 = list(zip(gdf2_centroids.y, gdf2_centroids.x)) | |
| #get all potential combinations between all points from sig1 and sig2 |
Freeze env for documentation and sharing:
pip list --format=freeze > requirements.txt