Skip to content

Instantly share code, notes, and snippets.

FROM --platform=linux/amd64 ghcr.io/osgeo/gdal:ubuntu-full-3.11.4
RUN apt-get update && \
apt-get install -y \
build-essential \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv --system-site-packages /opt/venv
@zabop
zabop / mre.py
Last active November 15, 2025 14:05
from osgeo import gdal
from PIL import Image
import numpy as np
import shapely.ops
import shapely
import pyproj
import sys
from typing import Callable
import numpy as np
import shapely.ops
import shapely
import pyproj
from typing import Callable
z,x,y = 6, 36, 16
maxc = 20037508.342789244
sidelength: Callable[[int], float] = lambda z: 2 * maxc / (2**z)
import numpy as np
import shapely
from typing import Callable
maxc = 20037508.342789244
sidelength: Callable[[int], float] = lambda z: 2 * maxc / (2**z)
def get_tile_centres(z: int, x: int, y: int) -> tuple[float, float]:
# return coordinates of tile centres in EPSG:3857
x = -maxc + maxc / (2**z) + sidelength(z) * x
@zabop
zabop / Dockerfile
Created October 30, 2025 09:49
tiles-with-filled-holes
FROM --platform=linux/amd64 ghcr.io/osgeo/gdal:ubuntu-full-3.11.4
RUN apt-get update && \
apt-get install -y \
build-essential \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv
FROM --platform=linux/amd64 ghcr.io/osgeo/gdal:ubuntu-full-3.11.4
RUN apt-get update && \
apt-get install -y \
build-essential \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.