A tool for generating XYZ tiles from IIIF Georeference Extension JSON and displaying them with MapLibre GL JS.

Requirements

  • Python 3.x
  • GDAL (gdal_translate, gdalwarp, gdal2tiles.py)

Installing GDAL

#b#srumeUdawbocuOinaSntpsut(t/HaDiolenmlbseitbgaardnlealwl)gdal-binpython3-gdal

Usage

python3scripts/iiif_georef_to_tiles.py<IIIF_GEOREF_JSON_URL>

Example

python3scripts/iiif_georef_to_tiles.pyhttps://nakamura196.github.io/iiif_geo/canvas.json

Options

OptionDefaultDescription
--scale0.25Image scale factor
--zoom14-18Tile zoom level range
--output-dirdocsOutput directory
--nametilesTile folder name
--work-dirworkWorking directory
--keep-work-Do not delete working files

Processing Flow

III123456F......GF(D(E(Ct(G(Gv(eefoImgorgegeiMotewIbdoadndnearctnIearnaeaewpehclFdldslrlreLfho_ifwa2arieJaIGtnoatttbrSfdmCrarreiereOraPatmplenNoigsnea)teHcmmestisTGealil.MLUgAaoepLJRePtnsyJSLIe)SO))))N

Conversion Results

Original imageAfter georeferencing

Output Files

docs/istnoidulerexcs11111.e45678h./////tjmslon###MOXarYpiZLgiitbniralelesGILIIJFSGveioerweefrerenceJSON

Local Preview

c#dOdpoecnsh&t&tpp:y/t/hloonc3al-hmoshtt:t8p0.0s0e/rver8000

IIIF Georeference Extension

The IIIF Georeference Extension is an extension specification for adding georeference information to IIIF images.

JSON Structure

{}"]"""""]@,twhiac""yietn{}ohhpdiennttetgmo""]ttt"hhsttiepp:"t"ayt{}x:::":tpet/":iem"""}"/C1[o"stmb:iia81.n:"yoo""}"]iin42.s:ptdtt,f[iiv19.""eiyyr""e{}ffa51]:A["v"patoa..s,1,n:a:enypt""}"}ii",[nt"sptutp,go,o"i{:feiryr"e""/tAoo"oeporotcaaann"r:nsepemyopptn"Fms""esepoiiio:ea""::roter//otatp:tur"depna"tio["iry:ixrPtguol{Fec"nteaiernyese:"aesgooe"n"a"CPtneenrC:oot:o{oesn""eomruoisit,,fl{idr{rn"oaelaeedt:ntrelr"s"/iec"",",[gont,::1enci3o/io1[9r3nn6.e/g"}67fc",96/o,021n,3/t1ce78ox52nt1,t.7ej]3xs5to..n7j"1s5o1n2"3,3]

Sample Data Source

The image used in the demo is obtained from:

References