---
title: "oft-gapfill issue cloud removal and gap filling Landsat 8 data"
url: "https://openforis.support/questions/260/oft-gapfill-issue-cloud-removal-and-gap-filling-landsat-8-data"
tags: ["geospatialtoolkit"]
status: "answered"
score: 0
answer_count: 3
asked: "2015-06-02T17:12:57"
last_activity: "2015-06-23T11:14:09"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# oft-gapfill issue cloud removal and gap filling Landsat 8 data

Asked by GeoShepherd on 2015-06-02

Hi Support,
I'm currently experiencing some issues with the use of oft-gapfill. It has been running and working as outlined in the exercises under oft-gapfill on your wiki page. Initial run of the executable with the following parameters (below) issues with the error that it needs to be re-run using a larger -sd. I follow the instructions and alter the -sd to a larger one. This is then followed by an error "Segmentation fault (core dumped)". I haven't experienced a seg error previously and I'm currently unsure of how to progress forward.  

    $ oft-gapfill -la 1 -nolocal -pm -sd 4 -ws 11 -um simple_mask.tif stack.tif filled_a_b.tif
outfile: filled_a_b.tif
LA model file: filled_a_b.tif.models
Using Mask file: simple_mask.tif
Allocating: 14130 14180 11
Using Large Area Model
LA: 1 1 14130.000000 14180.000000
Allocate: 113040
Allocated
Processing
0 1 2 3 4 5 6 7 8 9
Building LA models
Error allocating memory for 95226704 observations in the sample array
Please re-run with higher -sd parameter value.
The current value was 4

    $ oft-gapfill -la 1 -nolocal -pm -sd 10 -um simple_mask.tif stack.tif filled_a_b.tif
outfile: filled_a_b.tif
LA model file: filled_a_b.tif.models
Using Mask file: simple_mask.tif
Allocating: 14130 14180 3
Using Large Area Model
LA: 1 1 14130.000000 14180.000000
Allocate: 113040
Allocated
Processing
0 1 2 3 4 5 6 7 8 9
Building LA models
Segmentation fault (core dumped)

The project is being performed on Landsat 8 imagery to remove and fill areas of significant cloud of the Cape York Peninsula, Australia. Currently I have a number of filled images using my anchor image, however I am trying to combine them all to end up with no gaps in the final image. 

Running OFGT version 1.26.6

Your assistance and guidance would be appreciated,
Regards,


## Answer (score 0, by Anssi on 2015-06-04)

Link: https://openforis.support/questions/260/oft-gapfill-issue-cloud-removal-and-gap-filling-landsat-8-data/262

Hello,

thanks for the report! 

Can you provide us with the necessary data sets to reproduce the problem? LS scene IDs and the mask file would be sufficient.

Best,

anssi


## Answer (score 0, by GeoShepherd on 2015-06-11)

Link: https://openforis.support/questions/260/oft-gapfill-issue-cloud-removal-and-gap-filling-landsat-8-data/269

Hi Anssi,

Thanks for your response. 

The L8 scenes being used currently are Path 98 Row 68 and 69. This is the Cape York Peninsula Australia and I currently have all scenes captured from Landsat 8 over those two regions. This specific scenes used in the above are LC80980682014056LGN00, LC80980682014136LGN00, LC80980682014152LGN00, LC80980682014232LGN00. The mask file was generated from the L8 BQA band using the L-DOPE toolbox to unpack the BQA band into binary where 1 represents cloud and 0 not. I have then combined the two masks following the instructions on the Open Foris tutorials, using raster calculator to assign the correct values.  

The problem has been when I try and fill the gaps left after the first fill attempt using the output from the gapfill and another filler image. 

Hope that gives you enough to proceed, let me know if not. 

Regards,
Owain


## Answer (score 0, by ejlindquist on 2015-06-23)

Link: https://openforis.support/questions/260/oft-gapfill-issue-cloud-removal-and-gap-filling-landsat-8-data/290

Dear Owain

We are still tracking down and trying to re-create the error you are receiving.  One option to try, however, would be to use a maximum NDVI compositing approach to create a best-pixel mosaic from the existing gap-filled images.  We have a separate script for this (called a multiFiller) which simply takes an anchor image and a number of additional images, calculates the NDVI for each pixel and then selects the maximum NDVI for creating the final, best-pixel composite.

Sorry to answer a question with a request rather than an answer....but can you tell me if you are using all the optical bands or just a subset of them to make the final composite?

Best
Erik
