Semi-Automated Building Footprint Extraction from Satellite Imagery for Autogen Creation in FSX/P3D

I am facing a problem when exporting reclassification image into raster. When I try to export the reclassified image using "r.out.gdal" command, then the output shows

"Input raster map contains cells with NULL-value (no-data). The value 255 will be used to represent no-data values in the input map. You can specify a nodata value with the nodata option.
The default nodata value is present in rasterband and would lead to data loss. Please specify a custom nodata value with the nodata parameter.
Raster export aborted.
Finished with error."
Now, what to do?


Resource contributor
Is it possible that you forgot to assign new values to certain classes? How many classes did you use in the unclassified supervision (step 7) and which classes did you assign to be black (value 0) or white (value 255)?
I may be wrong but the error sounds like certain classes were not reclassified. Nonetheless, it states that those with null values should now be all white (value 255), but since it is aborting on this error, try placing the value 0 in the last box on the creation tab. This should turn any no data values to black and avoid the stop error.

If you are using the command line, use nodata=0.

I have used 9 classes and used the following classification rule

0 thru 7 = 0
8 thru 9 = 255

And this is my reclassified image. But here, the large white portion represents no data. and the white portion inside grey represents 255. I think this is the problem as you mentioned that I cannot reclassify the no data value.


I tried with 0 value in the creation tab but it shows the same problem (WARNING: The user given nodata value 0 is present in rasterband <reclass@msngh_m> and would lead to data loss. Please specify a different nodata value with the nodata parameter.
ERROR: Raster export aborted).
Now, how can I manage the problem?



Resource contributor
I see the issue. The nodata option for r.out doesn't change the null input values but instead represents those output values as nodata.
I have long removed QGIS from my PC, but a quick search has shown that r.null may be able to help. I will do some further reading to see if I can guide you but here is the link:

Try running and set the null value to 0 on the classified map that you are using. It seems that r.null cannot be run on reclassified images so this must be done as the last part of the unsupervised classification (step 7).

Last edited:
It works and I can export.
But after exporting the image looks like this

And then when I apply Blob Remover tool it shows that

" * * * Blob Remover * * *

* * * WARNING * * *
This routine works only with Bmp or Raw files 8 bit
Raw files should have 'dim' header with image dimension


Input file should have black background "

A folder named "Folder cut" created but contains partial data like "partial_00.bmp.aux"

What is wrong with that and how to apply the tool?


Resource contributor
Did you reclassify the image after running r.null?
If so you should only be left with a black and white image. Your empty space should be fully black now.

When exporting did you change the raster data format to BMP, and, in the Creation Tab, ensure that you checked Do not write the GDAL standard colortable and selected Byte as the Data Type for export?
Earlier I tried it in qgis 1.7.4-wroclaw and then the problem happened. But when I use qgis 2.16.1-Nodebo it works and the exported image is

I change the raster data format to BMP, and, in the Creation Tab, checked Do not write the GDAL standard colortable and selected Byte as the Data Type for export.
So, I think now the image is in correct format. But when I apply Blob remover tool it shows that complete but no file is created in the same folder or in other folder. What is the problem?


Resource contributor
It is possible that the blob remover tool may be crashing before it finishes.
Try running the tool from the command line to see if it returns any errors before it disappears.

You can use similar code to automatically open the tool for you:

START cmd.exe /k "D:\Program Files\BREC\BlobRemover\blob_removerwin.exe"
Paste it into notepad and save the file with extension .bat

If that fails you will have to try using photoshop to remove blobs manually.
Or you could skip this step entirely and resort to using either ScenProc's code, or GIS software utilities to filter out the small polygons they will generate.
Dear Zev,
After applying blob remover tool I have got the following image


And after that I had applied building cleaner tool and got the following image


I do not use scenproc yet because of having no previous idea about it. But I am scared that my final result is not so good.



Resource contributor
Ok. There is a forum here dedicated to ScenProc, and the manual is also handy. You will get there eventually. Don't be afraid to ask questions.
Dear Zev,
My ScenProc shows warning message


Can I work on it in spite of having warning?
Another question is the code you given, would I paste it in notepad and then connect to ScenProc?


Resource contributor
Falguni, the correct sim probably has not been set in ScenProcs settings. You should still be able to use it despite warnings.
The code can be typed directly in ScenProc after you click on "New".
It will be better to post questions regarding ScenProc in its dedicated forum. Please also don't forget to read the manual.