IIIF Georeference Extension JSONからXYZタイルを生成し、MapLibre GL JSで表示するツール。

必要環境

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

GDALのインストール

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

使用方法

python3scripts/iiif_georef_to_tiles.py<IIIF_GEOREF_JSON_URL>

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

オプション

オプションデフォルト説明
--scale0.25画像の縮小率
--zoom14-18タイルのズームレベル範囲
--output-dirdocs出力ディレクトリ
--nametilesタイルフォルダ名
--work-dirwork作業用ディレクトリ
--keep-work-作業用ファイルを削除しない

処理の流れ

III123456F......GJ((G(((H(eSUICgggTMoORIPdddMarNLIaaaLpeFlllLf_w2iefItatbremrriretaaplencgn)echessGe)l.LAapJPtyJSIe)SO)))N

変換結果

元画像地理参照後

出力ファイル

docs/istnoidulerexcs11111.e45678h./////tjmslon###MXaYpIZLIiIbFreGeGoLreJfSerenceJSON

ローカルで確認

c#dhdtotcps:/&/&lopcyatlhhoons3t:-8m00h0t/tp.server8000

IIIF Georeference Extension

IIIF Georeference Extensionは、IIIF画像に地理参照情報を付与するための拡張仕様です。

JSONの構造

{}"]"""""]@,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]

サンプルデータの出典

デモで使用している画像は以下から取得しています:

参考