RGB TIFF goes black when zoomed out in QGIS 3.4!












3















Am importing a RGB TIFF into QGIS 3.4 and when I zoom in I can see the image properly, however, when I zoom out the layer turns black (most of it) and red (a small portion). After doing some search I found this, which suggests that this problem is caused by issues with pyramids and statistics with the layer. There is some support there but that is for ArcGIS. I tried building the pyramids in QGIS Raster-->Miscellaneous-->Build Overviews (Pyramids) (I have done it in the past for .asc files), but got the following error



ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.
ERROR 1: An error occurred while writing a dirty block from GDALRasterBand::RasterIO


Does anyone know how I could to build pyramids for a TIFF in QGIS? If so, what "Overview levels" should I select?



Or does anyone know how to solve this issue for my RGB TIFF?










share|improve this question




















  • 1





    Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

    – Michael Stimson
    2 hours ago













  • @Michael Stimson, I think your comment is worthy of posting as an answer!

    – Ben W
    2 hours ago
















3















Am importing a RGB TIFF into QGIS 3.4 and when I zoom in I can see the image properly, however, when I zoom out the layer turns black (most of it) and red (a small portion). After doing some search I found this, which suggests that this problem is caused by issues with pyramids and statistics with the layer. There is some support there but that is for ArcGIS. I tried building the pyramids in QGIS Raster-->Miscellaneous-->Build Overviews (Pyramids) (I have done it in the past for .asc files), but got the following error



ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.
ERROR 1: An error occurred while writing a dirty block from GDALRasterBand::RasterIO


Does anyone know how I could to build pyramids for a TIFF in QGIS? If so, what "Overview levels" should I select?



Or does anyone know how to solve this issue for my RGB TIFF?










share|improve this question




















  • 1





    Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

    – Michael Stimson
    2 hours ago













  • @Michael Stimson, I think your comment is worthy of posting as an answer!

    – Ben W
    2 hours ago














3












3








3








Am importing a RGB TIFF into QGIS 3.4 and when I zoom in I can see the image properly, however, when I zoom out the layer turns black (most of it) and red (a small portion). After doing some search I found this, which suggests that this problem is caused by issues with pyramids and statistics with the layer. There is some support there but that is for ArcGIS. I tried building the pyramids in QGIS Raster-->Miscellaneous-->Build Overviews (Pyramids) (I have done it in the past for .asc files), but got the following error



ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.
ERROR 1: An error occurred while writing a dirty block from GDALRasterBand::RasterIO


Does anyone know how I could to build pyramids for a TIFF in QGIS? If so, what "Overview levels" should I select?



Or does anyone know how to solve this issue for my RGB TIFF?










share|improve this question
















Am importing a RGB TIFF into QGIS 3.4 and when I zoom in I can see the image properly, however, when I zoom out the layer turns black (most of it) and red (a small portion). After doing some search I found this, which suggests that this problem is caused by issues with pyramids and statistics with the layer. There is some support there but that is for ArcGIS. I tried building the pyramids in QGIS Raster-->Miscellaneous-->Build Overviews (Pyramids) (I have done it in the past for .asc files), but got the following error



ERROR 1: TIFFAppendToStrip:Maximum TIFF file size exceeded. Use BIGTIFF=YES creation option.
ERROR 1: An error occurred while writing a dirty block from GDALRasterBand::RasterIO


Does anyone know how I could to build pyramids for a TIFF in QGIS? If so, what "Overview levels" should I select?



Or does anyone know how to solve this issue for my RGB TIFF?







qgis qgis-3.0 rgb image-pyramids






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago









Vince

14.4k32747




14.4k32747










asked 3 hours ago









Juan OssaJuan Ossa

797




797








  • 1





    Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

    – Michael Stimson
    2 hours ago













  • @Michael Stimson, I think your comment is worthy of posting as an answer!

    – Ben W
    2 hours ago














  • 1





    Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

    – Michael Stimson
    2 hours ago













  • @Michael Stimson, I think your comment is worthy of posting as an answer!

    – Ben W
    2 hours ago








1




1





Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

– Michael Stimson
2 hours ago







Can you use command line? If so use GDALAddO gdal.org/gdaladdo.html first with -clean to get rid of existing pyramids then use the same command with -ro so as not to internalize the pyramids. Depending on the size of your raster levels should be 4 8 16 32 64 but if very large add 128 256 to the levels. The problem comes from your GeoTIFF not being a large GeoTIFF and you're exceeding the 4GiB limit by internalizing your pyramids, specifying -ro will force GDALAddO to write the overviews to a separate file, thus not increasing your existing file size.

– Michael Stimson
2 hours ago















@Michael Stimson, I think your comment is worthy of posting as an answer!

– Ben W
2 hours ago





@Michael Stimson, I think your comment is worthy of posting as an answer!

– Ben W
2 hours ago










1 Answer
1






active

oldest

votes


















3














This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded.



From here you have some options, the error message indicates using BIGTIFF=YES which you can do from QGIS with Raster::Translate, writing a new file which can exceed the 4 GiB limit, for example this post describes the process.



Or if you're comfortable with the CMD tools you can attempt repair the existing TIFF file in a two step process:




  1. Remove the existing bad pyramids with GDALAddO -clean option. It is important to remove the existing internal pyramids before creating new external pyramids as this would create a conflict of which pyramids to use; I would think that the internal pyramids would take precedence but that's an assumption - I haven't tried this to prove which takes precedence.

  2. Create new external pyramids with GDALAddO -ro option which will force the creation of an OVR or RRD (–config USE_RRD YES) file to contain the pyramids. For most rasters levels of 4 8 16 32 64 (5 levels of pyramid) is sufficient but if your file is especially large use 4 8 16 32 64 128 256 to create 7 levels.


This may not work if the file is already too broken to fix, if this is the case your only option is to translate the file to a new raster.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "79"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f308782%2frgb-tiff-goes-black-when-zoomed-out-in-qgis-3-4%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded.



    From here you have some options, the error message indicates using BIGTIFF=YES which you can do from QGIS with Raster::Translate, writing a new file which can exceed the 4 GiB limit, for example this post describes the process.



    Or if you're comfortable with the CMD tools you can attempt repair the existing TIFF file in a two step process:




    1. Remove the existing bad pyramids with GDALAddO -clean option. It is important to remove the existing internal pyramids before creating new external pyramids as this would create a conflict of which pyramids to use; I would think that the internal pyramids would take precedence but that's an assumption - I haven't tried this to prove which takes precedence.

    2. Create new external pyramids with GDALAddO -ro option which will force the creation of an OVR or RRD (–config USE_RRD YES) file to contain the pyramids. For most rasters levels of 4 8 16 32 64 (5 levels of pyramid) is sufficient but if your file is especially large use 4 8 16 32 64 128 256 to create 7 levels.


    This may not work if the file is already too broken to fix, if this is the case your only option is to translate the file to a new raster.






    share|improve this answer




























      3














      This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded.



      From here you have some options, the error message indicates using BIGTIFF=YES which you can do from QGIS with Raster::Translate, writing a new file which can exceed the 4 GiB limit, for example this post describes the process.



      Or if you're comfortable with the CMD tools you can attempt repair the existing TIFF file in a two step process:




      1. Remove the existing bad pyramids with GDALAddO -clean option. It is important to remove the existing internal pyramids before creating new external pyramids as this would create a conflict of which pyramids to use; I would think that the internal pyramids would take precedence but that's an assumption - I haven't tried this to prove which takes precedence.

      2. Create new external pyramids with GDALAddO -ro option which will force the creation of an OVR or RRD (–config USE_RRD YES) file to contain the pyramids. For most rasters levels of 4 8 16 32 64 (5 levels of pyramid) is sufficient but if your file is especially large use 4 8 16 32 64 128 256 to create 7 levels.


      This may not work if the file is already too broken to fix, if this is the case your only option is to translate the file to a new raster.






      share|improve this answer


























        3












        3








        3







        This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded.



        From here you have some options, the error message indicates using BIGTIFF=YES which you can do from QGIS with Raster::Translate, writing a new file which can exceed the 4 GiB limit, for example this post describes the process.



        Or if you're comfortable with the CMD tools you can attempt repair the existing TIFF file in a two step process:




        1. Remove the existing bad pyramids with GDALAddO -clean option. It is important to remove the existing internal pyramids before creating new external pyramids as this would create a conflict of which pyramids to use; I would think that the internal pyramids would take precedence but that's an assumption - I haven't tried this to prove which takes precedence.

        2. Create new external pyramids with GDALAddO -ro option which will force the creation of an OVR or RRD (–config USE_RRD YES) file to contain the pyramids. For most rasters levels of 4 8 16 32 64 (5 levels of pyramid) is sufficient but if your file is especially large use 4 8 16 32 64 128 256 to create 7 levels.


        This may not work if the file is already too broken to fix, if this is the case your only option is to translate the file to a new raster.






        share|improve this answer













        This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded.



        From here you have some options, the error message indicates using BIGTIFF=YES which you can do from QGIS with Raster::Translate, writing a new file which can exceed the 4 GiB limit, for example this post describes the process.



        Or if you're comfortable with the CMD tools you can attempt repair the existing TIFF file in a two step process:




        1. Remove the existing bad pyramids with GDALAddO -clean option. It is important to remove the existing internal pyramids before creating new external pyramids as this would create a conflict of which pyramids to use; I would think that the internal pyramids would take precedence but that's an assumption - I haven't tried this to prove which takes precedence.

        2. Create new external pyramids with GDALAddO -ro option which will force the creation of an OVR or RRD (–config USE_RRD YES) file to contain the pyramids. For most rasters levels of 4 8 16 32 64 (5 levels of pyramid) is sufficient but if your file is especially large use 4 8 16 32 64 128 256 to create 7 levels.


        This may not work if the file is already too broken to fix, if this is the case your only option is to translate the file to a new raster.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 hours ago









        Michael StimsonMichael Stimson

        21.2k22260




        21.2k22260






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f308782%2frgb-tiff-goes-black-when-zoomed-out-in-qgis-3-4%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Liste der Baudenkmale in Friedland (Mecklenburg)

            Single-Malt-Whisky

            Czorneboh