Skip to content

Instantly share code, notes, and snippets.

View wipfli's full-sized avatar

Oliver Wipfli wipfli

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<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' />
<link href="https://demotiles.maplibre.org/style.json" rel="preload" as="fetch" />
<link href="https://demotiles.maplibre.org/tiles/tiles.json" rel="preload" as="fetch" />
<link href="https://demotiles.maplibre.org/tiles/1/1/1.pbf" rel="preload" as="fetch" />
@wipfli
wipfli / indexed-font-encoder.md
Created December 3, 2023 17:34
Indexed Font Encoder

Indexed Font Encoder

I would like to create an indexed font encoder. It should be an application that takes the following as input:

  • labels.json: a list of map labels to encode
  • .ttf fonts: a directory containing ttf font files used for the encoding
  • ignore_codepoints.json: a list of unicode codepoints which should be ignored for the encodoing

And the output of the application should be:

Vector Landcover Notes

I would like to be able to make myself one day a vector landcover tileset that looks as good as the ones of the large consumer maps. I tried doing this a bit but so far I have not found a good solution.

The landcover should give you an idea how the nature looks like in a place, whatever that means...

In this gist I would like to write down some notes around the challenges of making a vector landcover tileset.

Related to onthegomap/planetiler#550

@wipfli
wipfli / arabic-notes.md
Last active August 28, 2023 15:33
Arabic Notes

Arabic Notes

Numbers

  • 1 [waːħid]
  • 2 [iθˈnaːn]
  • 3 [θaˈlaːθa]
  • 4 [ʔarbaʕ]
  • 5 [xamsa]
  • 6 [sitta]
@wipfli
wipfli / ibbq-python-bleak.py
Last active August 3, 2023 07:17
iBBQ Python Bleak Script
# iBBQ sensor readout script using python bleak
#
# Source code was copied from https://github.com/8none1/pybq which is licensed under the GPLv3.0.
# For the license of the original script see https://github.com/8none1/pybq/blob/master/LICENSE
#
# Was adapted to use the python bleak package instead of bluepy using ChatGPT.
#
# Thanks to Will Cooke (https://github.com/8none1/) for providing the orginal version!

Task

The download URLs look like:

https://s3-eu-west-1.amazonaws.com/vito.landcover.global/v3.0.1/2019/E000N60/E000N60_PROBAV_LC100_global_v3.0.1_2019-nrt_Bare-CoverFraction-layer_EPSG-4326.tif

template:

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:

#!/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 \

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")