Skip to content

Instantly share code, notes, and snippets.

View wipfli's full-sized avatar

Oliver Wipfli wipfli

View GitHub Profile
@wipfli
wipfli / be-shift.ipynb
Created November 18, 2021 12:23
Differential AC-Stark shift calculation on the S to P Transition of Beryllium at 1050 nm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

digitalocean droplet:

ubuntu-m-16vcpu-128gb-fra1-01
128 GB / 16 CPUs
400 GB SSD Disk
8 TB transfer

command:

@wipfli
wipfli / power-omt-planetiler.md
Created March 11, 2022 13:27
power-omt-planetiler.md

Adding a power layer to OpenMapTiles with planetiler

OpenMapTiles v3.14 does not include the power tag. This gist shows how to add it in a new layer with planetiler.

Step 1: OpenMapTiles

@wipfli
wipfli / marker-hover.html
Created March 16, 2022 10:05
Change size of marker on hover with CSS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Attach a popup to a marker instance</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" />
<style>
body { margin: 0; padding: 0; }
@wipfli
wipfli / shapefile-to-mbtiles-with-planetiler.md
Last active March 24, 2022 06:29
Shapefile to mbtiles with Planetiler

Shapefile to mbtiles with Planetiler

Example how to generate a .mbtiles file from .shp file with Planetiler. This uses data from Swiss natural protected areas call "Aulav" which are given in the countries EPSG:2056 coordinate system.

Steps

Set up the java environment according to the Planetiler contributing guidelines.

Send me a secret

If you want to send me a secret like a password or some login details, follow these steps on an ubuntu machine:

echo "<your-secret-password>" > secretfile.txt
openssl rand -out secret.key 32

running:

SELECT ?item ?itemLabel ?coord
WHERE
{
  ?item wdt:P31/wdt:P279* wd:Q70208;
        wdt:P17 wd:Q39;
        rdfs:label ?itemLabel;
        wdt:P625 ?coord;
  FILTER (lang(?itemLabel) = "de")
#!/usr/bin/env bash
set -e
rm -rf comparison.txt
echo "start pmtiles ############################" 2>&1 | tee -a comparison.txt
start=$(date +%s)
java -cp target/*-with-deps.jar com.onthegomap.planetiler.examples.SwissMap \
--download --area=planet --bounds=world \
--download-threads=10 --download-chunk-size-mb=1000 \
--fetch-wikidata \

Add buildings to bicycle example in planetiler

git clone https://github.com/onthegomap/planetiler.git
cd planetiler/planetiler-examples

Edit src/main/java/com/onthegomap/planetiler/examples/BikeRouteOverlay.java and add the following lines: