developmentseed / eoAPI

[Active Development] Earth Observation API (Metadata, Raster and Vector services)
https://eoapi.dev
MIT License
191 stars 20 forks source link

Raster API Info does not return the info #156

Closed Leon-Carto closed 8 months ago

Leon-Carto commented 8 months ago

Problem description

I have added the item from digital africa s2_l2a. It shows the boundary on the index.html but when it does not show the image on viewer page and raise the error {"detail":"'/vsis3/deafrica-sentinel-2/sentinel-s2-l2a-cogs/35/Q/RA/2017/1/S2A_35QRA_20170101_1_L2A/AOT.tif' does not exist in the file system, and is not recognized as a supported dataset name."}

Screen Shot 2023-11-10 at 00 59 36 Screen Shot 2023-11-10 at 01 01 08

Expected Output

It should return the image on the map

Screen Shot 2023-11-10 at 01 02 39

Environment Information

Ubuntu 22-04 Docker version 24.0.6 python 3.10.12 EoAPI release: 0.1.0 (TBD)

vincentsarago commented 8 months ago

@Leon-Carto did you allowed deafrica-sentinel-2 bucket in you IAM role for the lambdas?

By default it's * but maybe you changed it https://github.com/developmentseed/eoAPI/blob/main/infrastructure/aws/cdk/config.py#L87-L91

vincentsarago commented 8 months ago
aws s3 ls --region af-south-1 --no-sign-request s3://deafrica-sentinel-2/sentinel-s2-l2a-cogs/35/Q/RA/2017/1/S2A_35QRA_20170101_1_L2A/AOT.tif
2020-10-13 12:41:52     102737 AOT.tif

rio cogeo info s3://deafrica-sentinel-2/sentinel-s2-l2a-cogs/35/Q/RA/2017/1/S2A_35QRA_20170101_1_L2A/AOT.tif
...
rasterio.errors.RasterioIOError: The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.

Oo That's interesting there might be something with GDAL/Rasterio or how the env variable are set in the service.

I guess the easiest way to fix this for now is to use https url instead of s3:// because the data is public

https://docs.digitalearthafrica.org/en/latest/platform_tools/direct_access.html

vincentsarago commented 8 months ago

Oo

we have to set two env variable for this bucket in af-south-1

AWS_S3_ENDPOINT=s3.af-south-1.amazonaws.com 
AWS_NO_SIGN_REQUEST=YES
AWS_S3_ENDPOINT=s3.af-south-1.amazonaws.com AWS_NO_SIGN_REQUEST=YES rio cogeo info s3://deafrica-sentinel-2/sentinel-s2-l2a-cogs/35/Q/RA/2017/1/S2A_35QRA_20170101_1_L2A/AOT.tif
Driver: GTiff
File: s3://deafrica-sentinel-2/sentinel-s2-l2a-cogs/35/Q/RA/2017/1/S2A_35QRA_20170101_1_L2A/AOT.tif
COG: True
Compression: DEFLATE
ColorSpace: None

Profile
    Width:            1830
    Height:           1830
    Bands:            1
    Tiled:            True
    Dtype:            uint16
    NoData:           0.0
    Alpha Band:       False
    Internal Mask:    False
    Interleave:       BAND
    ColorMap:         False
    ColorInterp:      ('gray',)
    Scales:           (1.0,)
    Offsets:          (0.0,)

Geo
    Crs:              EPSG:32635
    Origin:           (799980.0, 2100000.0)
    Resolution:       (60.0, -60.0)
    BoundingBox:      (799980.0, 1990200.0, 909780.0, 2100000.0)
    MinZoom:          8
    MaxZoom:          11

Image Metadata
    AREA_OR_POINT: Area
    OVR_RESAMPLING_ALG: MODE

Image Structure
    COMPRESSION: DEFLATE
    INTERLEAVE: BAND
    PREDICTOR: 2

Band 1
    ColorInterp: gray

IFD
    Id      Size           BlockSize     Decimation           
    0       1830x1830      256x256       0
    1       915x915        128x128       2
    2       458x458        128x128       4
    3       229x229        128x128       8