geospatial-jeff / aiocogeo

Asynchronous cogeotiff reader
MIT License
72 stars 10 forks source link

chunk transfer #95

Closed geospatial-jeff closed 3 years ago

geospatial-jeff commented 3 years ago

Implements chunk transfer encoding. This was already enabled through the Filesystem.read() method, so this mostly involved improving the efficiency of tag reading. I did have to remove parallel tag reading (#92) since the tags are not aware of each other and would send the same 16kb request multiple times, but overall this makes things faster.

To make things simpler for now, we coerce the chunk size to be at least the minimum size required to accomplish the operation that initiated the request (ex. chunk size is 10k but reading a tag value requires 15k bytes). This also makes it possible to test the differences between chunk sizes, as setting a chunk size of 0 will essentially disable chunking for all header requests. This could be an issue on larger images with really big offset tags, but aiocogeo doesn't support BigTiff yet anyways!

Closes #76

TODOs:

codecov-io commented 3 years ago

Codecov Report

Merging #95 (16a750f) into master (e5b7b48) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
+ Coverage   93.23%   93.25%   +0.01%     
==========================================
  Files          12       12              
  Lines        1079     1082       +3     
==========================================
+ Hits         1006     1009       +3     
  Misses         73       73              
Impacted Files Coverage Δ
aiocogeo/cog.py 93.87% <100.00%> (+0.02%) :arrow_up:
aiocogeo/config.py 100.00% <100.00%> (ø)
aiocogeo/filesystems.py 83.25% <100.00%> (+0.07%) :arrow_up:
aiocogeo/ifd.py 96.68% <100.00%> (ø)
aiocogeo/tag.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e5b7b48...16a750f. Read the comment docs.