I'm trying to set up a workflow for reporters of damaged industrial sites that may be polluting after Harvey and other storms and disasters. Currently people often upload large batches of files to Flickr or Google Drive, but Archive.org is a more sustainable place with a better API.
But I'm also trying to get aerial photos of affected sites (like the flooded oil and gas facilities shown below) to appear on a Leaflet map by using the Archive.org JSON API, which is great.
To make a map on the fly, I'm using
exif-js (https://www.npmjs.com/package/exif-js) to access the EXIF metadata of images from Archive.org. But when I do that, I get this error, because
exif-js uses XMLHttpRequest to get the exif data:
XMLHttpRequest cannot load https://archive.org/download/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg. Redirect from 'https://archive.org/download/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg' to 'https://ia601501.us.archive.org/35/items/grn-harvey/a-img_6340-pert-coke-overflow_36263420874_o_thumb.jpg' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
I tried a non-redirecting URL, but then I get:
XMLHttpRequest cannot load https://ia601501.us.archive.org/35/items/grn-harvey/a-img_6856-active-pump-oyster-marsh-restoration-cameron-parish_36701894030_o_thumb.jpg. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
Enabling an 'Access-Control-Allow-Origin' header is relatively straightforward. Does anyone know someone at Archive.org who can help with this?
My map code is here: https://github.com/publiclab/leaflet-archive
Demo here: http://publiclab.github.io/leaflet-archive/ (not completely online yet but should be shortly)
Example Harvey image from our current workflow: