Skip to content

Instantly share code, notes, and snippets.

View wipfli's full-sized avatar

Oliver Wipfli wipfli

View GitHub Profile
@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")

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
@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.