mapreader.download.iiif_downloader

Classes

IIIFDownloader

Module Contents

class mapreader.download.iiif_downloader.IIIFDownloader(iiif, iiif_versions='infer', iiif_uris=None)
Parameters:
  • iiif (str | piffle.iiif_dataclasses.presentation3.IIIFPresentation3 | piffle.iiif_dataclasses.presentation2.IIIFPresentation2 | list[str | piffle.iiif_dataclasses.presentation3.IIIFPresentation3 | piffle.iiif_dataclasses.presentation2.IIIFPresentation2])

  • iiif_versions (int | float | str | list[int | float | str])

  • iiif_uris (str | list[str] | None)

iiif = []
save_georeferenced_maps(path_save='maps')

Save georefereced maps from a IIIF presentation 3 json as tiffs.

Parameters:

path_save (str | pathlib.Path) – Path to save the images

Notes

Calls the save_georeferenced_map method for each IIIF object.

save_georeferenced_map(iiif, path_save='maps', iiif_uri=None)

Save a single georefereced map from a IIIF presentation 3 json as a tiff.

Parameters:
  • iiif (str | dict | IIIFPresentation3) – the IIIF url or IIIF presentation API object containing the map(s)

  • path_save (str | pathlib.Path) – Path to save the images

  • iiif_uri (str) – The URI of the IIIF object, needed if the IIIF object is missing an ‘id’ field.

Notes

Only first order polynomial transformations are currently supported, see the [allmaps documentation](https://allmaps.org/) for more information on the transformation options.

Raises:

ValueError – Only first order polynomial transformations are currently supported.

Parameters:
  • iiif (str | piffle.iiif_dataclasses.presentation3.IIIFPresentation3)

  • path_save (str | pathlib.Path)

  • iiif_uri (str)

save_maps(path_save='maps')

Save maps from a IIIF presentation json as pngs.

Parameters:

path_save (str | pathlib.Path) – Path to save the images

Notes

Calls the save_map method for each IIIF object.

save_map(iiif, iiif_version=3, path_save='maps', iiif_uri=None)

Save a single map from a IIIF presentation json as a png.

Parameters:
  • iiif (str | dict | IIIFPresentation3 | IIIFPresentation2) – the IIIF url or IIIF presentation API object containing the map(s)

  • iiif_version (int | float | str) – The IIIF version, ignored if iiif is already a IIIF object

  • path_save (str | pathlib.Path) – Path to save the images

  • iiif_uri (str) – The URI of the IIIF object, needed if the IIIF object is missing an ‘id’ field.

download_image(iiif_version, annot)