geospatial-jeff / aiocogeo

Asynchronous cogeotiff reader
MIT License
73 stars 10 forks source link

Running aiocogeo in docker #119

Open philvarner opened 1 year ago

philvarner commented 1 year ago

I had many problems getting this installed locally, mostly due to imagecodecs requiring dozens of libraries by default and incompatible unconstrained dependencies. I got it two work with the following:

First run an ubuntu docker container:

docker run -it ubuntu

This install these:

apt update && apt upgrade -y 
apt-get install -y pip build-essential python3-dev cython3 python3-setuptools python3-pip
python3 -m pip install -U pip setuptools wheel Cython
pip install imagecodecs --global-option="build_ext" --global-option="--lite"
pip install aioboto3==8.1.1
pip install -U aiohttp==3.6.2
pip install aiocogeo==0.3.0

and run

aiocogeo info s3://usgs-landsat/collection02/level-2/standard/oli-tirs/2020/072/076/LC08_L2SR_072076_20201203_20210313_02_T2/LC08_L2SR_072076_20201203_20210313_02_T2_SR_B1.TIF

Success:

        FILE INFO: https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/41/X/NA/2023/3/S2A_41XNA_20230309_0_L2A/AOT.tif

          PROFILE
            Width:            1830
            Height:           1830
            Bands:            1
            Dtype:            uint16
            Crs:              EPSG:32641
            Origin:           (499980.0, 8100000.0)
            Resolution:       (60.0, -60.0)
            BoundingBox:      (499980.0, 7990200.0, 609780.0, 8100000.0)
            Compression:      deflate
            NoData:           0
            Internal mask:    False
            Header size:      16385

      IFD
                Id      Size           BlockSize     MinTileSize (KB)     MaxTileSize (KB)     MeanTileSize (KB)
        0       1830x1830      256x256       0.149                1.351                0.279
        1       915x915        128x128       0.052                0.73                 0.122
        2       458x458        128x128       0.052                0.807                0.175
        3       229x229        128x128       0.052                0.641                0.281