Here is the code to reproduce the analysis in this blog post
Also hosted here
Install rangehttpserver
to be able to launch a local web server that supports HTTP range requests so that we can simulate a "real" webserver.
pip install rangehttpserver memory_profiler GDAL
Download the two raster datasets from here.
One is a valid COG (labeled with the _COG
suffix) and the other is invalid.
Place these files in a dedicated directory from which to launch the web server
Run the following to launch a webserver where you save the above data files
python -m RangeHTTPServer
Run the test script for the valid and invalid files individually and count the the amount of GET requests on the web server to see the difference in efficiencies.
python test_cog.py