finds.dev← search

// the find

commenthol/gdal2tiles-leaflet

★ 504 · Python · MIT · updated Oct 2021

Generate raster image tiles for use with leaflet.

A patched version of GDAL's gdal2tiles.py that flips the tile origin to the upper-left corner so raster images (non-geographic maps, game maps, floor plans) work correctly in Leaflet. The companion plugin leaflet-rastercoords handles the coordinate math on the browser side. Aimed at anyone needing to make a zoomable, pan-able viewer for a large image that isn't a real map.

The core patch is small and targeted — just origin flipping and raster profile support, no bloat. Multicore tile generation is included via a second script, which matters when you're tiling a 20,000px image. The test directory gives a working end-to-end example with real image and shell script, not just a stub. The README accurately explains the minimum zoom level constraint with a concrete calculation example.

Abandoned since 2021 and based on a GDAL version from 2013 — the upstream gdal2tiles.py has changed substantially and modern GDAL (3.x) ships its own Python 3 version, so this fork diverges from a moving target. No pip package, no versioned releases, just a raw script you copy into your project. The setup.py exists but installing it puts an old frozen script on your PATH, which is worse than not installing it. No tests for the actual tile output correctness — just a manual shell script.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →