Bug report #20611
Data used and imported for calculation are again exported and created with the result of a calculation
|Affected QGIS version:||3.5(master)||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||wontfix|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28431|
For result in a directory, data used are created and exported again with the result... with processing/GRASS/raster r.mapcalc function and maybe more (functions)...
Thanks Jürgen Fischer because we can use GRASS in processing of QGIS 3.5.0 (maybe too for the next 3.4.2???) and Windows...
Example if i use this expression in processing/grass/raster > r.mapcalc:
My data : DEM (in a different dierctory of the result directory)
My expression : NEWDEM=DEM+10
Choose a directory for result : temporary (or a definitive place)
a file "NEWDEM.tif" is created in the result directory... but ...
(i remind "DEM.tif" is the file used for calculation. It seems not necessary to export it again)
I think the problem is due to the fact that the data is imported into a temporary grass project with the r.in.gdal to do the calculation next.
Then the export is done from the result of the g.list function in this temporary grass project, result which lists the input data...
So, DEM is imported with r.in.gdal, <*any GRASS functions?*>, listed (not excluded) with g.list to prepare exportation and exported again (data calculated too) with r.out.gdal...
<r.mapcalc function is used between import and export>...
#3 Updated by Olivier ATHIMON almost 2 years ago
- Assignee set to Jürgen Fischer
- File step_01_to_step20.zip added
if we choose to create result in the same directory of a data input, we get the result of a formula, but data input is re-created (same datetime for data input and data created)... A message (Step03) gives the information...
- one to create a new file from a formula : g=DEM+100 (directory from data input to directory with result : pics from Step01 to Step05...)
- I also noticed that if QGIS is not closed and I run several calculations then each of these calculations is kept in memory and relaunched (so, from an old formula and an old file created with this formula and destroyed after... Step01 : i destroyed the file "f.tif" calculated before and QGIS created again the file (f.tif) from the old formula and created the new file with the new formula : g=DEM+100 from step02 to step05)
- step 06 to step09 : new formula (DEM1000=DEM+1000)
- step 10 : i destroy all files in my directory, except the file: DEM.tif...
- step 11 to step 15 with a new formula : DEM3000=DEM+3000... DEM.tif is overwritten, result file : DEM3000.tif is created... and all old destroyed files are created again : f.tif, g.tif and DEM1000.tif (not desired in the new formula)
- step 16 to step 20 : on the contrary, if I close QGIS, destroy old files (step 16) and launch a new formula then only the result of this formula is given with despite the overwritting of the input data (step17 to Step 20)
So, the old formula are kept (and relaunched with a new calculation) if we don't close QGIS session...