53,367 images extracted from a collection of 65,000 digitised books (largely from the 19th Century), that were identified as maps.
# imports
import zipfile
import urllib
import json
import io
# RUN this CELL if using BINDER or a LOCAL Jupyter Notebooks SERVER (see bellow for Google Colab)
# read JSON metadata file (311MB) inside Flickr_BLPhotos20200330_maps.zip (20.8MB))
filename = "../DataBL/19cbooks/Flickr_BLPhotos20200330_maps.zip"
# unzips the files Flickr_BLPhotos20200330_maps.zip
z = zipfile.ZipFile(filename)
# RUN this CELL if using Google COLAB
# read JSON metadata file (311MB) inside Flickr_BLPhotos20200330_maps.zip (20.8MB))
zip_file = "https://github.com/BL-Labs/Jupyter-notebooks-projects-using-BL-Sources/raw/master/DataBL/19cbooks/Flickr_BLPhotos20200330_maps.zip"
# OR test loading it from data.bl.uk
# zip_file = "http://data.bl.uk/19cbooks/Flickr_BLPhotos20200330_maps.zip"
import urllib.request
access_url = urllib.request.urlopen(zip_file)
# unzips the files inside book_data.zip
z = zipfile.ZipFile(io.BytesIO(access_url.read()))
# loads JSON from the first (only) file inside into a list
meta = json.loads(z.read(z.infolist()[0]).decode('utf-8'))
# number of records inside this list
len(meta['rows'])
53367
# checking a certain record (0 to 53366)
print("\nWhich record you would like to view?")
i = int(input("(0 to " + str(len(meta['rows'])-1) + "): "))
print("\n")
meta['rows'][i]
Which record you would like to view? (0 to 53366): 373
{'alephSysNumber': '000490438', 'description': 'Image taken from:\r\n\t\t\r\n<strong>Title</strong>: "A Voyage of Discovery to the North Pacific Ocean ... Performed in His Majesty´s Sloop Providence, and her tender, in the years 1795, 1796, 1797, 1798 [With plates, including maps.]"\r\n<strong>Author(s)</strong>: Broughton, William Robert [person]\r\n<strong>British Library shelfmark</strong>: "Digital Store 981.g.22"\r\n<strong>Page</strong>: 127 (scanned page number - not necessarily the actual page number in the publication)\r\n<strong>Place of publication</strong>: London (England)\r\n<strong>Date of publication</strong>: 1804\r\n<strong>Publisher</strong>: T. Cadell & W. Davies\r\n<strong>Type of resource</strong>: Monograph\r\n<strong>Language(s)</strong>: English\r\n<strong>Physical description</strong>: xx, 393 pages (4°)\t\t\r\n\t\t\r\n<strong>Explore this item</strong> in the British Library’s catalogue: \r\n<a href="http://explore.bl.uk/primo_library/libweb/action/search.do?cs=frb&doc=BLL01000490438&dscnt=1&scp.scps=scope:(BLCONTENT)&frbg=&tab=local_tab&srt=rank&ct=search&mode=Basic&dum=true&tb=t&indx=1&vl(freeText0)=000490438&fn=search&vid=BLVU1" rel="nofollow">000490438</a> (physical copy) and <a href="http://explore.bl.uk/primo_library/libweb/action/search.do?cs=frb&doc=BLL01014846952&dscnt=1&scp.scps=scope:(BLCONTENT)&frbg=&tab=local_tab&srt=rank&ct=search&mode=Basic&dum=true&tb=t&indx=1&vl(freeText0)=014846952&fn=search&vid=BLVU1" rel="nofollow">014846952</a> (digitised copy)\r\n(numbers are British Library identifiers)\r\n\r\n<strong>Other links related to this image:</strong>\r\n- <strong>View</strong> this image as a scanned publication on the <a href="http://access.bl.uk/item/viewer/ark:/81055/vdc_0000000065E2#?cv=126" alt="Open the book scan page in the British Library’s Universal Viewer">British Library’s online viewer</a> (you can download the image, selected pages or the whole book)\r\n- <strong>View</strong> this <a href="http://britishlibrary.georeferencer.com/id/10999570306" rel="noreferrer nofollow">digitised map overlaid on a modern map</a> using the <strong>British Library’s Georeferencer service</strong>\r\n- <strong>Order</strong> a <a href="http://tiny.cc/BL-Digitisation-Services" alt="The British Library: Digitisation Services">higher quality scanned version of this image</a> from the British Library\r\n\r\n<strong>Other links related to this publication:</strong>\r\n- <strong>View</strong> all the <a href="http://www.flickr.com/photos/britishlibrary/tags/sysnum000490438">illustrations found in this publication</a>\r\n- <strong>View</strong> all the <a href="http://www.flickr.com/photos/britishlibrary/tags/date1804">illustrations in publications from the same year</a> (1804)\r\n- <strong>Download</strong> the Optical Character Recognised (OCR) <a href="https://data.bl.uk/19cbooks/json/0004/000490438_01_text.json">derived text</a> for this publication as JavaScript Object Notation (JSON)\r\n\r\n- <strong>Explore</strong> and experiment</strong> with the British Library’s <a href="https://data.bl.uk/" alt="British Library’s digital collections">digital collections</a>\r\n\r\nThe British Library community is able to flourish online thanks to freely available resources such as this. \r\n\r\nYou can help support our mission to continue making our collection accessible to everyone, for research, inspiration and enjoyment, by donating on the British Library supporter <a href="http://tiny.cc/BL-Donate" alt="Donate to The British Library">webpage here</a>. \r\n\r\nThank you for supporting the <a href="https://www.bl.uk" alt="The British Library">British Library</a>.', 'geoRefId': '10999570306', 'machine_tags': 'otherhalf:pair=1099960467610999570306 geo:osmscale=12 geo:continent=asia geo:country=jp geo:country=japan geo:state=hokkaidōregion geo:statedistrict=北海道hokkaidō geo:county=usudistrict geo:city=muroran sherlocknet:tag=import sherlocknet:tag=manufacture sherlocknet:tag=port sherlocknet:tag=high sherlocknet:tag=water sherlocknet:tag=direct sherlocknet:tag=island sherlocknet:tag=france sherlocknet:tag=general sherlocknet:tag=land sherlocknet:tag=portion sherlocknet:tag=rise sherlocknet:tag=western sherlocknet:tag=fine sherlocknet:tag=coast sherlocknet:tag=consider sherlocknet:category=maps', 'page': 127, 'photoid': '10999570306', 'tags': 'bldigital date1804 pubplacelondon publicdomain sysnum000490438 broughtonwilliamrobert large vol0 page127 mechanicalcurator imagesfrombook000490438 imagesfromvolume0004904380 map split otherhalf:pair=1099960467610999570306 righthalf hasgeoref geo:osmscale=12 geo:continent=asia geo:country=jp geo:country=japan geo:state=hokkaidōregion geo:statedistrict=北海道hokkaidō geo:county=usudistrict geo:city=muroran sherlocknet:tag=import sherlocknet:tag=manufacture sherlocknet:tag=port sherlocknet:tag=high sherlocknet:tag=water sherlocknet:tag=direct sherlocknet:tag=island sherlocknet:tag=france sherlocknet:tag=general sherlocknet:tag=land sherlocknet:tag=portion sherlocknet:tag=rise sherlocknet:tag=western sherlocknet:tag=fine sherlocknet:tag=coast sherlocknet:tag=consider sherlocknet:category=maps', 'title': 'British Library digitised image from page 127 of "A Voyage of Discovery to the North Pacific Ocean ... Performed in His Majesty´s Sloop Providence, and her tender, in the years 1795, 1796, 1797, 1798 [With plates, including maps.]"', 'url_c': 'https://live.staticflickr.com/3830/10999570306_245843fb39_c.jpg', 'url_o': 'https://live.staticflickr.com/3830/10999570306_122cb0ddb3_o.jpg', 'views': 1517}
print('\nTitle:')
print(meta['rows'][i]['title']+'\n')
print('* Flickr record:')
print('https://www.flickr.com/photos/britishlibrary/'+meta['rows'][i]['geoRefId']+'\n')
print('* This book\'s catalog record at BL explorer:')
print('http://explore.bl.uk/primo_library/libweb/action/search.do?cs=frb&doc=BLL'+ meta['rows'][i]['alephSysNumber'] + '&dscnt=1&scp.scps=scope:(BLCONTENT)&frbg=&tab=local_tab&srt=rank&ct=search&mode=Basic&dum=true&tb=t&indx=1&vl(freeText0)='+ meta['rows'][i]['alephSysNumber'] + '&fn=search&vid=BLVU1'+'\n')
print('* This map on BL\'s GeoReferencer Service:')
print('http://britishlibrary.georeferencer.com/id/'+ meta['rows'][i]['geoRefId']+'\n')
print('\nAs of 30th March 2020, this image / map had '+ str(meta['rows'][i]['views']) +' views.\n')
Title: British Library digitised image from page 127 of "A Voyage of Discovery to the North Pacific Ocean ... Performed in His Majesty´s Sloop Providence, and her tender, in the years 1795, 1796, 1797, 1798 [With plates, including maps.]" * Flickr record: https://www.flickr.com/photos/britishlibrary/10999570306 * This book's catalog record at BL explorer: http://explore.bl.uk/primo_library/libweb/action/search.do?cs=frb&doc=BLL000490438&dscnt=1&scp.scps=scope:(BLCONTENT)&frbg=&tab=local_tab&srt=rank&ct=search&mode=Basic&dum=true&tb=t&indx=1&vl(freeText0)=000490438&fn=search&vid=BLVU1 * This map on BL's GeoReferencer Service: http://britishlibrary.georeferencer.com/id/10999570306 As of 30th March 2020, this image / map had 1517 views.
print('\nImage Description:\n')
from IPython.core.display import HTML
HTML(meta['rows'][i]['description'].replace('\r\n','<br>'))
Image Description:
print('\nAnd the image / map:\n')
HTML('<img src="'+meta['rows'][i]['url_c']+'">')
And the image / map:
print('\nDownload the original image / map:\n')
print(meta['rows'][i]['url_o']+'\n')
Download the original image / map: https://live.staticflickr.com/3830/10999570306_122cb0ddb3_o.jpg