tpilz / lumpR

Landscape Unit Mapping Program for R
GNU General Public License v3.0
11 stars 12 forks source link

issues grass7_2018 #43

Closed tpilz closed 6 years ago

tpilz commented 6 years ago

- to be continued -

Remaining issues I observed with my test dataset along with GRASS 7 adaptation:

Observed changes in behaviour in comparison to lumpR v2.5.0, latest GRASS 6.4 based version (@TillF check if this could be reasonable):

Function execution times:

- to be continued -

TillF commented 6 years ago

I'll respond point by point: area2catena(): I could not reproduce this. Reclass files are produced as soon as an svc-layer is present, regardless of the flag. Does this explain your observation?

TillF commented 6 years ago

reservoir_lumped(): Tried to test this, but it requires reservoir_outlet() to be run first. This routine has not yet migrated to grass7. I started off, but I guess you can do this quicker.

TillF commented 6 years ago
tpilz commented 6 years ago

area2catena(): I could not reproduce this. Reclass files are produced as soon as an svc-layer is present, regardless of the flag. Does this explain your observation?

In my case the reclass files are only produced if svc is given without explicit mapset reference via "@" operator. Furthermore, I don't understand why these files shall be produced when grass_files = FALSE.

order of subbasins: Probably a result of your workaround with R-categories? Who cares, as long as the results stay the same.

I agree.

EHA IDs changed: In eha-raster? compared to GRASS6? This would not be problematic, would it?

It wouldn't, I just wondered. But it's not important.

results of area2catena() differ: I did not touch the actual computations, I cannot explain this

For some EHAs I also have slightly different cell counts than before. I only cannot identify the reason for this.

tpilz commented 6 years ago

Note: the grass_files issue of area2catena() was introduced in commit afbc509c07a12a1af583ce4c24630196b1ecb853 but still I don't get the point.

tpilz commented 6 years ago

@TillF see latest updates of remaining issues in the initial post.

TillF commented 6 years ago

From my side, lumpR for GRASS7 can be released.

tpilz commented 6 years ago

db_create() now works with overwrite = 'drop' but not with overwrite = 'empty:

Error in SQL query execution while updating db.
Query:   ALTER TABLE vegetation ADD COLUMN intfc DOUBLE ;
error-message: HY000 1 [SQLite]duplicate column name: intfc (1)

which seems to be raised by an internal call to db_update(dbname, db_ver).

A-Mue commented 6 years ago

Tested on Windows, for an approx. 80 000 km² catchment (30m-resolution DEM):

A) Execution from apply_lumpR_template calc_subbas() Problem: nothing happens, but no error messages

Issued meassages:

_%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % START calcsubbas() % Initialise function... ... % Calculate drainage and river network... ... ABSCHNITT 4: Schließe Karten. % OK

--> duration ca. 6 min

_% Snap given drainage points to streams... Exporting 116 features... VOUTOG1 komplett. 116 features (Point type) written to (SQLite format). Exporting 24786 features... VOUTOG1 komplett. 24786 features (Line String type) written to

(SQLite format). % OK_ **--> duration ca. 10 min** _% Calculate catchments for every drainage point..._ --> This is the last issued message, but nothing happens anymore (run over night) --> Output created: basin_calc_t (spurious subbas not yet eliminated, map not clipped) basin_recl basin_outlet_t **B) Execution with local version of "subbasin.R" (attached)** **1. Problem with deletion of temporary Grass files** The temporary files created by GrassGIS should be deleted several times in "subbasin.R", but R issued the message "Permission denied". _> if(.Platform$OS.type == "windows") { dir_del <- dirname(execGRASS("g.tempfile", pid=1, intern=TRUE, ignore.stderr=T)) files_del <- grep(substr("dp_t", 1, 8), dir(dir_del), value = T) file.remove(paste(dir_del, files_del, sep="/")) }_ I manually deleted the files in the folder ".../GrassGIS_Data/Location/Mapset/.tmp/unknown/" **2. Subbasin at catchment outlet is set to NA** Line-by-line exection of "subbasin.R", lines skipped: 366–430 In map "basin_all_t": last subbas at outlet has ID 0; this command creates NA: _> execGRASS("r.null", map=basin_out, setnull="0")_ In the next step, this warning is issued: _> no_cross <- length(execGRASS("r.stats", input=basin_out, flags=c("n"), intern=T, ignore.stderr = T)) > if(no_catch != no_cross) warning... Warning message: Number of categories in subbas not equal to number of drainage points! This might be because ..._ I "quick-fixed" this, by manually reclassifying "basin_all_t" (0=1, 1=2, ..., 115=116) and named this new map "subbas". [subbasin.txt](https://github.com/tpilz/lumpR/files/2525767/subbasin.txt)