UNDP-Data / geo-cogserver

GeoHub COG server
GNU General Public License v3.0
1 stars 1 forks source link

`more than one 'dtype' found` error in /vrt endpoint #73

Closed JinIgarashi closed 3 months ago

JinIgarashi commented 3 months ago

URL tested

http://localhost:8000/vrt?url=https%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20231229.rade9d_sunfiltered.tif&url=https%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20231229.vcld.tif&url=https%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20240101.rade9d_sunfiltered.tif&url=https%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20240101.rade9d_sunfiltered.tif

it returns the below XML

VRT contents ```xml PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]] -2.0037507887139618e+07, 4.9597749279942963e+02, 0.0000000000000000e+00, 1.2933139225895356e+07, 0.0000000000000000e+00, -4.9597810663372002e+02 3.4028234663852886e+38 /vsicurl/https://undpgeohub.blob.core.windows.net/geo-nightlights/test/SVDNB_npp_d20231229.rade9d_sunfiltered.tif 1 3.4028234663852886e+38 ZSTD BAND COG 3 256x256 Type=Float32, ColorInterp=Gray 3.4028235e+38 Gray 255 /vsicurl/https://undpgeohub.blob.core.windows.net/geo-nightlights/test/SVDNB_npp_d20231229.vcld.tif 1 255 ZSTD BAND COG 2 256x256 Type=Byte, ColorInterp=Gray 255 Gray 3.4028234663852886e+38 /vsicurl/https://undpgeohub.blob.core.windows.net/geo-nightlights/test/SVDNB_npp_d20240101.rade9d_sunfiltered.tif 1 3.4028234663852886e+38 ZSTD BAND COG 3 256x256 Type=Float32, ColorInterp=Gray 3.4028235e+38 Gray 3.4028234663852886e+38 /vsicurl/https://undpgeohub.blob.core.windows.net/geo-nightlights/test/SVDNB_npp_d20240101.rade9d_sunfiltered.tif 1 3.4028234663852886e+38 ZSTD BAND COG 3 256x256 Type=Float32, ColorInterp=Gray 3.4028235e+38 Gray ```

When I use this vrt in titler, it returns more than one 'dtype' found error. vrt contains both Float32 and BYTE. We need to set same data type (in this case float 32) for all bands

URL for statistics api

http://localhost:8000/cog/statistics?url=http%3A%2F%2Flocalhost%3A8000%2Fvrt%3Furl%3Dhttps%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20231229.rade9d_sunfiltered.tif%26url%3Dhttps%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20231229.vcld.tif%26url%3Dhttps%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20240101.rade9d_sunfiltered.tif%26url%3Dhttps%3A%2F%2Fundpgeohub.blob.core.windows.net%2Fgeo-nightlights%2Ftest%2FSVDNB_npp_d20240101.rade9d_sunfiltered.tif&unscale=false&resampling=nearest&reproject=nearest&categorical=false&histogram_bins=8