1

I am using Landsat 8 satellite imagery for doing Supervised Classification using Semi Automatic Classification Plugin (SCP) in QGIS.

I have created ROI's and done all the procedures for doing the Supervised Classification. But, when I am finally executing the SCP plugin for creating the output file of classification, I am getting the given below error.

An error has occurred while executing Python code: 
RuntimeError: Deleting C:/Users/Sreeraj/AppData/Local/Temp/semiautomaticclassification/20180817_125852974000/20180817_125944159000/sig_1_1_20180817_130833289000.tif failed: Permission denied 

Traceback (most recent call last):

File "C:/Users/Sreeraj/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\classificationdock\classificationdock.py", line 520, in runClassificationAction
self.runClassification()

File "C:/Users/Sreeraj/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\classificationdock\classificationdock.py", line 599, in runClassification
ok, opOut, mOut = self.runAlgorithm(cfg.algName, img, sL, cfg.clssPth, cfg.macroclassCheck, None, None, None, compress)

File "C:/Users/Sreeraj/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\classificationdock\classificationdock.py", line 432, in runAlgorithm
oRL, opOut = cfg.utls.createSignatureClassRaster(signatureList, rD, cfg.tmpDir, cfg.NoDataVal, None, previewSize, previewPoint, "No")

File "C:/Users/Sreeraj/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 846, in createSignatureClassRaster
oRL = self.createRasterFromReference(gdalRasterRef, 1, outputRasterList, nodataValue, "GTiff", cfg.rasterDataType, previewSize, previewPoint, compress, compressFormat)

File "C:/Users/Sreeraj/.qgis2/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 2744, in createRasterFromReference
oR = tD.Create(o, c, r, bandNumber, format)

File "C:\OSGeo4W\apps\Python27\lib\site-packages\osgeo\gdal.py", line 1502, in Create
return _gdal.Driver_Create(self, *args, **kwargs)

RuntimeError: Deleting C:/Users/Sreeraj/AppData/Local/Temp/semiautomaticclassification/20180817_125852974000/20180817_125944159000/sig_1_1_20180817_130833289000.tif failed:

Permission denied

Eventhough I tried to solve this by many different ways, all my attempts were unsuccessful.

I can see many files generated in the folder C:/Users/Sreeraj/AppData/Local/Temp/semiautomaticclassification/ when I execute this plugin and I can also see a tif file named sig_1_1_20180817_130833289000.tif (this tif file is having 0 KB size).

How can I solve this issue and what is the exact reason for this error ?

Note: When I am executing the plugin for the continuous 2nd attempt (even after getting above error during 1st attempt), I am getting the given below error in the Python console :-

Exception RuntimeError: 'TIFFResetField:C:\\Users\\Sreeraj\\AppData\\Local\\Temp\\semiautomaticclassification/20180817_135719707000/sig_2_2_20180817_142402476000.tif: Can not read TIFF directory entry.' in <built-in function delete_Dataset> ignored

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.