question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: VRT already has an alpha band

See original GitHub issue

Hey there people, I created some custom .tif file and would like to serve it with terracotta. However, I get the following error when calling terracotta serve -r {name}.tif

Error message: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.6/dist-packages/terracotta/server/flask_api.py", line 49, in inner return fun(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/terracotta/server/singleband.py", line 152, in get_singleband_preview return _get_singleband_image(keys) File "/usr/local/lib/python3.6/dist-packages/terracotta/server/singleband.py", line 166, in _get_singleband_image image = singleband(parsed_keys, tile_xyz=tile_xyz, **options) File "/usr/lib/python3.6/contextlib.py", line 52, in inner return func(*args, **kwds) File "/usr/local/lib/python3.6/dist-packages/terracotta/handlers/singleband.py", line 45, in singleband tile_size=tile_size, preserve_values=preserve_values File "/usr/local/lib/python3.6/dist-packages/terracotta/xyz.py", line 27, in get_tile_data asynchronous=asynchronous File "/usr/local/lib/python3.6/dist-packages/terracotta/drivers/base.py", line 20, in inner return fun(self, *args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/terracotta/drivers/raster_base.py", line 562, in get_raster_tile result = future.result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception rasterio.errors.WarpOptionsError: The VRT already has an alpha band, adding a new one is not supported

My .tif file: https://cloudstorage.tu-braunschweig.de/getlink/fiHGTTUZHaDHMjf9tiKBjvLC/ortho.tif

I guess the problem is the creation of my .tif file, probably some bad flags or channels? The map is not displayed in the preview tool. I see the outlines, but not more.

Thanks for your help and best regards, Alex

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
laxnpandercommented, Jun 23, 2020

@dionhaefner: Alright, didn’t know that. Thanks for the quick response! I tested a couple of open source tileserver over the past few days and Terracotta is my favourite so far. Really nice work!

1reaction
dionhaefnercommented, Jun 23, 2020

Should be fixed on master. Would be nice if you could verify. As I said, reading will be slow, so be patient 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

WarpedVRT is unexpected scaling the data #2104 - GitHub
Yes, it's only because the metadata don't tell explicitly that the 4th band is not an alpha band. 1
Read more >
Mosaicing GeoTIFFs with gdal creates gaps due to alpha layers
What has been working so far for me is setting nodata to all 4 bands of the image in areas where the alpha...
Read more >
3254 (gdalbuildvrt create raster with collars in overlapped area)
Does your source raster have nodata values, an alpha band or just white collars ? I'd note that gdalbuildvrt in trunk (1.7.0dev) brings...
Read more >
VRT – GDAL Virtual Format — GDAL documentation
A raster band may have many “sources” indicating where the actual raster data should be fetched from, and how it should be mapped...
Read more >
rasterio.vrt module - Read the Docs
add_alpha (bool, optional) – Whether to add an alpha masking band to the virtual dataset. Default: False. This option will cause deletion of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found