Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No RGB available for selection #310

Closed
jackmismash opened this issue Aug 8, 2023 · 6 comments
Closed

No RGB available for selection #310

jackmismash opened this issue Aug 8, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jackmismash
Copy link

When in the terracotta preview app, I try to select rgb. There are no bands available for selection from the drop down when i switch to rgb. Nothing loads either. Any suggestions?

For reference, this is when i click to change the R band. Nothing shows up:
image

@dionhaefner
Copy link
Collaborator

That's strange. Does singleband work? Do you see any errors in the javascript console?

@jackmismash
Copy link
Author

jackmismash commented Aug 9, 2023

Singleband does work, and grayscale tiles do appear and I can zoom in and watch the tiles load. If it helps, I have .tif images from the USGS Earth Explorer. When I run terracotta optimize-rasters on these tif files the logging says there are multiple bands in the image so it only selects one which I believe is the desired behavior, since there are multiple bands in the image. I am trying to use gdal to split the file into multiple bands. e.g. if my file name is 'file.tif' I split it into 4 different files using gdal to get each band using this command: gdal_translate -b 1 in.tif out1.tif e.g. ->

gdal_translate -b 1 file.tf file_B1.tif
gdal_translate -b 2 file.tf file_B2.tif
gdal_translate -b 3 file.tf file_B3.tif
gdal_translate -b 4 file.tf file_B4.tif

When I use terracotta optimize-rasters on these files, since there is only one band in each file, the log doesn't show anything about selecting only one band. After I put these files into the sqlite database and serve it up, no tiles appear at all and the web application is completely blank. The logging shows that my GET request for keys, swagger.json, datasets, and keys works (those all happen in that respective order). However, the GET request for metadata fails:

"GET /metadata/B1/file HTTP/1.1" 404 -
"GET /metadata/B2/file HTTP/1.1" 404 -
"GET /metadata/B3/file HTTP/1.1" 404 -
"GET /metadata/B4/file HTTP/1.1" 404 -

Also, if it helps my terracotta ingest command is as follows:

terracotta ingest path/{name}_{band}.tif -o banded.sqlite where path is my path to my cloud optimized raster files.

During this ingest stage, it says my tif does not have a valid nodata value, and does not contain an alpha band. It also says no data will be masked. After the ingest command is done, I am left with a bunch of random files in my folder e.g. if my file was named file_B01.tif, after ingestion I have a file_B01.tif.msk and a tmp{...}.tif.msk where {...} represents some auto generated id from what it seems.

Lastly, in terms of the first image, there are no js console errors until i set the rgb bands to the blank option which leads them to be undefined so I get an internal serval error with status 404 which makes sense since r=undefined, g=undefined and b=undefined doesn't work.

Hopefully this helps.

@dionhaefner
Copy link
Collaborator

Thanks, that's helpful. It sounds like you did everything correctly.

A 404 error indicates that no dataset has been found with the given keys. I'm also confused by GET /metadata/B1/file, shouldn't it be GET /metadata/file/B1 given that the pattern is {name}_{band}.tif?

Can you run the server from the command line, then point your browser to localhost:5000/keys and localhost:5000/datasets and post the output here?

@jackmismash
Copy link
Author

It seems like a previewer issue, I ran it from postman and was able to receive rgb images. I pointed it to cesium.js and I am able to receive and zoom into rgb tiles. However, when trying to run 'terracotta connect localhost:5000', the previewer doesn't show anything. I am not sure what could be the issue, but I think the server is working, just not the previewer web app.

@dionhaefner
Copy link
Collaborator

Yes it seems like something is wrong with the metadata requests, which isn't used by cesium.

Could do what I suggested above? I.e.,

  1. Start the server with terracotta serve.
  2. Go to localhost:5000/keys and localhost:5000/datasets in a browser window or use curl, then post the results here (not using the web app).

@dionhaefner
Copy link
Collaborator

Duplicate of #314.

@dionhaefner dionhaefner closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants