Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-20 Thread Jamille Haarloo
Thank you Helmut,
R is not found:
'R' is not recognized as an internal or external command, operable program
or batch file.
Currently looking for information online about what to do.

I also installed the winGRASS 8.3 via/in OSGeo4W v2, but now there is also
a problem with g.extension to add v.class.mlR. I tried it on my laptop and
work computer. Same problem.


Exception in thread
Thread-14
:
Traceback (most recent call last):
  File "C:\OSGeo4W\apps\Python39\lib\threading.py", line
954, in _bootstrap_inner

self.run()
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\core\gthr
ead.py", line 154, in __run

self.__run_backup()
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\core\gthr
ead.py", line 117, in run

ret = vars()["callable"](*args, **kwds)
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\modules\e
xtensions.py", line 369, in Load

raise GException(_("Unable to load extensions. %s") % msg)
core.gcmd
.
GException
:
Unable to load extensions. Traceback (most recent call
last):
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2855, in 
sys.exit(main())
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2803, in main
xmlurl = resolve_xmlurl_prefix(original_url, source=source)
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2492, in resolve_xmlurl_prefix
version_branch = get_version_branch(VERSION[0])
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 507, in get_version_branch
branch = gs.Popen(
File "C:\OSGeo4W\apps\grass\grass83\etc\python\grass\script\
core.py", line 55, in __init__
raise OSError(_("Cannot find the executable
{0}").format(args[0]))
OSError: Cannot find the executable git



On Wed, Jul 19, 2023 at 3:02 PM Helmut Kudrnovsky  wrote:

> >I am using standalone winGRASS, but installed it with OSGeo4W because I
> also use QGIS.
>
> I don't understand this. How do you install standalone winGRASS with
> OSGeo4W? But that's another question.
>
> Jürgen re-packaged now winGRASS 8.3.0 in OSGeo4W version 2 including the
> Rbatch-files.
>
> have a look at
> https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L520 and
> following code lines.
>
> the relevant one is
> https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L532
>
> "echo   path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line
> session (0)"
>
> just tried here in OSGeo4W version 2 with re-packaged winGRASS 8.3.0:
>
> * starting a GRASS session
> * typing into the windows console: R path => this adds temporarily the
> path to R to %PATH%
> * typing into the windows console: RScript -e "sessionInfo()" => outputs
> all necessary infos if R is correctly found (as Micha suggested)
>
> when temporarily the path to R is added to %PATH% within the winGRASS
> session, try v.class.mlR.
>
>
> Kind regards
> Helmut
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-18 Thread Jamille Haarloo
I am using standalone winGRASS, but installed it with OSGeo4W because I
also use QGIS.
I was using version 8.2.1, but went back to 7.8.5 and OSGeo4W v1.
With R4.3.1 getting other errors, and with R4.0 there was also trouble
finding the R script? (FileNotFoundError: [WinError 2] The system cannot
find the file specified.)
I checked the input text files. These don't have NA values.
I am doing a test classification with limited training-data.
---
*Msg when using R4.3.1*
Running R now. Following output is R output.
During startup - Warning messages:
1: Setting LC_COLLATE=en_US.cp1252 failed
2: Setting LC_CTYPE=en_US.cp1252 failed
3: Setting LC_MONETARY=en_US.cp1252 failed
4: Setting LC_TIME=en_US.cp1252 failed
Loading required package: ggplot2
Loading required package: lattice
Warning messages:
1: package 'caret' was built under R version 4.3.1
2: package 'ggplot2' was built under R version 4.3.1
Warning message:
package 'data.table' was built under R version 4.3.1
Something is wrong; all the Accuracy metric values are missing:
Accuracy   Kappa
 Min.   : NA   Min.   : NA
 1st Qu.: NA   1st Qu.: NA
 Median : NA   Median : NA
 Mean   :NaN   Mean   :NaN
 3rd Qu.: NA   3rd Qu.: NA
 Max.   : NA   Max.   : NA
 NA's   :4 NA's   :4
Error: Stopping
In addition: There were 33 warnings (use warnings() to see them)
Execution halted
ERROR: There was an error in the execution of the R script.
Please check the R output.

On Tue, Jul 18, 2023 at 3:43 PM Helmut Kudrnovsky  wrote:

> >>Is it best to go back to the previous versions for the meantime?
> >
> >yes, that would be an option.
> >
> >are you using OSGeo4W or standalone winGRASS?
> >
> >these R-batch-files are living also in the source:
> >
> >https://github.com/OSGeo/grass/tree/main/mswindows/external/rbatch
> >
> >and are integrated into extrabin-folder of the winGRASS standalone
> installer.
> >
> >could you try the standalone installer? which version are you using?
>
> see also discussion at:
>
> https://github.com/OSGeo/grass/discussions/3091
>
>
>
>
>
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-17 Thread Jamille Haarloo
Thank you Helmut.
Is it best to go back to the previous versions for the meantime?

On Mon, Jul 17, 2023 at 4:20 PM Helmut Kudrnovsky  wrote:

> >ok, I misunderstood. I'm getting a similar response.
> >C:\Users\haarlooj\Documents>Rscript -e "sessionInfo()"
> >'Rscript' is not recognized as an internal or external command,
> >operable program or batch file.
>
> the reason is that the Rbatch-files from OSGeo4W version 1 (
> https://download.osgeo.org/osgeo4w/v1/x86_64/release/rbatch/) are not yet
> included in OSGeo4W version 2 (compare
> https://download.osgeo.org/osgeo4w/v2/x86_64/release/).
>
> winGRASS 8 is based upon OSGeo4W version 2.
>
> kind regards
> Helmut
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-17 Thread Jamille Haarloo
ok, I misunderstood. I'm getting a similar response.
C:\Users\haarlooj\Documents>Rscript -e "sessionInfo()"
'Rscript' is not recognized as an internal or external command,
operable program or batch file.

On Mon, Jul 17, 2023 at 11:07 AM Micha Silver  wrote:

>
> On 17/07/2023 16:56, Jamille Haarloo wrote:
>
> Thank you Micha,
>
> This was the msg following "C:\Users\haarlooj\Documents> sessionInfo()":
> 'sessionInfo' is not recognized as an internal or external command,
> operable program or batch file.
>
> What you need to try is:
>
>
> Rscript -e "sessionInfo()"
>
>
> The GRASS module v.class.mlR  needs to be able to "find" the Rscript
> executable in order to run.
>
>
> I looked for the location and found this as location of R:
> C:\Program Files\R\R-4.3.0\bin\x64
> Location for Rstudio:
> C:\Program Files\RStudio
>
> Is it correct that I need to change the paths? What is the best method?
>
> Best,
> Jamille
>
>
> On Sat, Jul 15, 2023 at 9:17 AM Micha Silver  wrote:
>
>> Hi Jamille
>>
>>
>> On 15/07/2023 2:04, Jamille Haarloo wrote:
>> > Dear all,
>> >
>> > What was the solution to this error? I recently got a similar error
>> > from the same module v.class.mlR. I am using GRASS GIS 8.2.1  on
>> > Windows 10.
>> >
>>
>> The previous post was in reference to MacOS. Can you check on your
>> system that the Rscript executable is available from the GRASS command
>> window? i.e.
>>
>> - start grass (even without the GUI)
>>
>> - go to the command shell
>>
>> - run Rscript -e "sessionInfo()"
>>
>>
>> This will identify if the problem is due to missing PATH in the env
>> variables.
>>
>>
>>
>> > Best,
>> > Jamille
>> >
>> > 
>> > Running R now. Following output is R output.
>> > Traceback (most recent call last):
>> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
>> > pts\v.class.mlR.py <http://v.class.mlR.py>", line 977, in 
>> > main()
>> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
>> > pts\v.class.mlR.py <http://v.class.mlR.py>", line 908, in main
>> > subprocess.check_call(
>> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
>> > 368, in check_call
>> > retcode = call(*popenargs, **kwargs)
>> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
>> > 349, in call
>> > with Popen(*popenargs, **kwargs) as p:
>> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
>> > 951, in __init__
>> > self._execute_child(args, executable, preexec_fn,
>> > close_fds,
>> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
>> > 1420, in _execute_child
>> > hp, ht, pid, tid = _winapi.CreateProcess(executable,
>> > args,
>> > FileNotFoundError: [WinError 2] The system cannot find the
>> > file specified
>> >
>> >
>> > On Sun, Feb 20, 2022 at 8:24 AM Nicklas Larsson via grass-user
>> >  wrote:
>> >
>> > Daniel,
>> >
>> > I assume you use the official GRASS app bundle for mac. If you are
>> > not using the final 8.0.0 version, but one of the release
>> > candidates, I'd suggest you download the latest. There are changes
>> > in the startup script in the final version that relate to PATH
>> > issues like this.
>> >
>> >
>> >
>> > Best,
>> > Nicklas
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Sunday, 20 February 2022, 01:55:28 CET, Daniel Kozar via
>> > grass-user  wrote:
>> >
>> >
>> >
>> >
>> >
>> > Hi Micha,
>> >
>> > Thanks for the reply. I ran the script lines you sent both in the
>> > terminal as well as a GRASS session. Rscript is recognized in the
>> > terminal command but not in the GRASS 8.0 command. Since GRASS 8.0
>> > did not recognize Rscript I tried making a symbolic link for
>> > "Rscript" to the full path: /usr/local/bin/Rscript. This still
>> > doesn't recognize the command and I'm unsure how else to work
>> > around it.
>> >
>> > Any Mac aficionados reading this - do you have an idea to resolve
>> >  

Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-17 Thread Jamille Haarloo
Thank you Micha,

This was the msg following "C:\Users\haarlooj\Documents> sessionInfo()":
'sessionInfo' is not recognized as an internal or external command,
operable program or batch file.

I looked for the location and found this as location of R:
C:\Program Files\R\R-4.3.0\bin\x64
Location for Rstudio:
C:\Program Files\RStudio

Is it correct that I need to change the paths? What is the best method?

Best,
Jamille


On Sat, Jul 15, 2023 at 9:17 AM Micha Silver  wrote:

> Hi Jamille
>
>
> On 15/07/2023 2:04, Jamille Haarloo wrote:
> > Dear all,
> >
> > What was the solution to this error? I recently got a similar error
> > from the same module v.class.mlR. I am using GRASS GIS 8.2.1  on
> > Windows 10.
> >
>
> The previous post was in reference to MacOS. Can you check on your
> system that the Rscript executable is available from the GRASS command
> window? i.e.
>
> - start grass (even without the GUI)
>
> - go to the command shell
>
> - run Rscript -e "sessionInfo()"
>
>
> This will identify if the problem is due to missing PATH in the env
> variables.
>
>
>
> > Best,
> > Jamille
> >
> > 
> > Running R now. Following output is R output.
> > Traceback (most recent call last):
> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
> > pts\v.class.mlR.py <http://v.class.mlR.py>", line 977, in 
> > main()
> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
> > pts\v.class.mlR.py <http://v.class.mlR.py>", line 908, in main
> > subprocess.check_call(
> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> > 368, in check_call
> > retcode = call(*popenargs, **kwargs)
> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> > 349, in call
> > with Popen(*popenargs, **kwargs) as p:
> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> > 951, in __init__
> > self._execute_child(args, executable, preexec_fn,
> > close_fds,
> >   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> > 1420, in _execute_child
> > hp, ht, pid, tid = _winapi.CreateProcess(executable,
> > args,
> > FileNotFoundError: [WinError 2] The system cannot find the
> > file specified
> >
> >
> > On Sun, Feb 20, 2022 at 8:24 AM Nicklas Larsson via grass-user
> >  wrote:
> >
> > Daniel,
> >
> > I assume you use the official GRASS app bundle for mac. If you are
> > not using the final 8.0.0 version, but one of the release
> > candidates, I'd suggest you download the latest. There are changes
> > in the startup script in the final version that relate to PATH
> > issues like this.
> >
> >
> >
> > Best,
> > Nicklas
> >
> >
> >
> >
> >
> >
> >
> > On Sunday, 20 February 2022, 01:55:28 CET, Daniel Kozar via
> > grass-user  wrote:
> >
> >
> >
> >
> >
> > Hi Micha,
> >
> > Thanks for the reply. I ran the script lines you sent both in the
> > terminal as well as a GRASS session. Rscript is recognized in the
> > terminal command but not in the GRASS 8.0 command. Since GRASS 8.0
> > did not recognize Rscript I tried making a symbolic link for
> > "Rscript" to the full path: /usr/local/bin/Rscript. This still
> > doesn't recognize the command and I'm unsure how else to work
> > around it.
> >
> > Any Mac aficionados reading this - do you have an idea to resolve
> > this?
> >
> > Thanks
> > Daniel
> >
> > On Sat, Feb 19, 2022 at 1:46 AM Micha Silver 
> > wrote:
> > > Hi
> > >
> > >
> > > On 19/02/2022 04:27, Daniel Kozar via grass-user wrote:
> > >> Hi everyone,
> > >>
> > >> When using the extension "v.class.mlR" I get an error [Message
> > 1] (see
> > >> below) that "Rscript" cannot be located. I traced this back to the
> > >> script for "v.class.mlR" and edited line 908 to read the direct
> > path
> > >> to Rscript - '/usr/local/bin/Rscript' rather than 'Rscript' alone.
> > >> However, when I re-open GRASS 8.0 I get an error [Message 2]
> > that the
> > >> extension failed when loading and that the operation isn't
> > permitted.
> > >> I allowed for the appl

Re: [GRASS-user] Rscript error when using v.class.mlR

2023-07-14 Thread Jamille Haarloo
Dear all,

What was the solution to this error? I recently got a similar error from
the same module v.class.mlR. I am using GRASS GIS 8.2.1  on Windows 10.

Best,
Jamille


Running R now. Following output is R output.
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
pts\v.class.mlR.py", line 977, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
pts\v.class.mlR.py", line 908, in main
subprocess.check_call(
  File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
368, in check_call
retcode = call(*popenargs, **kwargs)
  File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
349, in call
with Popen(*popenargs, **kwargs) as p:
  File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
951, in __init__
self._execute_child(args, executable, preexec_fn,
close_fds,
  File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable,
args,
FileNotFoundError: [WinError 2] The system cannot find the
file specified


On Sun, Feb 20, 2022 at 8:24 AM Nicklas Larsson via grass-user <
grass-user@lists.osgeo.org> wrote:

> Daniel,
>
> I assume you use the official GRASS app bundle for mac. If you are not
> using the final 8.0.0 version, but one of the release candidates, I'd
> suggest you download the latest. There are changes in the startup script in
> the final version that relate to PATH issues like this.
>
>
>
> Best,
> Nicklas
>
>
>
>
>
>
>
> On Sunday, 20 February 2022, 01:55:28 CET, Daniel Kozar via grass-user <
> grass-user@lists.osgeo.org> wrote:
>
>
>
>
>
> Hi Micha,
>
> Thanks for the reply. I ran the script lines you sent both in the terminal
> as well as a GRASS session. Rscript is recognized in the terminal command
> but not in the GRASS 8.0 command. Since GRASS 8.0 did not recognize Rscript
> I tried making a symbolic link for "Rscript" to the full path:
> /usr/local/bin/Rscript. This still doesn't recognize the command and I'm
> unsure how else to work around it.
>
> Any Mac aficionados reading this - do you have an idea to resolve this?
>
> Thanks
> Daniel
>
> On Sat, Feb 19, 2022 at 1:46 AM Micha Silver  wrote:
> > Hi
> >
> >
> > On 19/02/2022 04:27, Daniel Kozar via grass-user wrote:
> >> Hi everyone,
> >>
> >> When using the extension "v.class.mlR" I get an error [Message 1] (see
> >> below) that "Rscript" cannot be located. I traced this back to the
> >> script for "v.class.mlR" and edited line 908 to read the direct path
> >> to Rscript - '/usr/local/bin/Rscript' rather than 'Rscript' alone.
> >> However, when I re-open GRASS 8.0 I get an error [Message 2] that the
> >> extension failed when loading and that the operation isn't permitted.
> >> I allowed for the application to have administrative rights but it
> >> still doesn't work. Does anyone know how to work around this or solve
> >> the issue finding "Rscript"?
> >>
> >> I have R running and have installed necessary packages. I'm
> >> running GRASS on MacOS Monterey.
> >
> >
> > This looks like a Mac problem (which I know nothing about).
> >
> > To test, can you run, first from a terminal:
> >
> > micha@RMS:~$ Rscript -e "sessionInfo()"
> >
> > Now run the same from within a GRASS session:
> >
> > (here's what I get)
> >
> > micha@RMS:QGIS$ g.version
> > GRASS 8.1.dev (2022)
> >
> > micha@RMS:QGIS$ Rscript -e "sessionInfo()"
> > R version 4.1.2 (2021-11-01)
> > Platform: x86_64-pc-linux-gnu (64-bit)
> > Running under: Debian GNU/Linux 11 (bullseye)
> >
> > Matrix products: default
> > BLAS:   /usr/lib/x86_64-linux-gnu/ openblas-pthread/libblas.so.3
> > LAPACK: /usr/lib/x86_64-linux-gnu/ openblas-pthread/libopenblasp-
> r0.3.13.so
> >
> > locale:
> >   [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C
> >   [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
> >   [5] LC_MONETARY=en_GB.UTF-8LC_MESSAGES=en_GB.UTF-8
> >   [7] LC_PAPER=en_GB.UTF-8   LC_NAME=C
> >   [9] LC_ADDRESS=C   LC_TELEPHONE=C
> > [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats graphics  grDevices utils datasets  methods base
> >
> > loaded via a namespace (and not attached):
> > [1] compiler_4.1.2
> >
> > If the Rscript executable is not found, then v.class.mlR cannot be run.
> >
> >
> >>
> >> Any help would be appreciated.
> >> - Daniel
> >> -- --
> -
> >> *[Message 1]*
> >>
> >> Running R now. Following output is R output.
> >>
> >> Traceback (most recent call last):
> >>
> >> File "/Users/dankozar/Library/ GRASS/8.0/Addons/scripts/v. class.mlR",
> >> line 977, in 
> >>
> >> main()
> >>
> >> File "/Users/dankozar/Library/ GRASS/8.0/Addons/scripts/v. class.mlR",
> >> line 908, in main
> >>
> >> subprocess.check_call(
> >>
> >> File
> >> "/Applications/GRASS-8.0.app/ Contents/Resources/lib/
> python3.9/subprocess.py",
> >> line 368, in check_call
> >>
> >> retcode = 

[GRASS-user] Grass 7.6 i.segment minsize working?

2019-06-18 Thread Jamille Haarloo
Dear Grass members,

I have been testing i.segment and i.segment.hierarchical on a small region
with Sentinel bands. However, the results consistently include segments of
just one pixel even-though minimal segment sizes of 10 and 20 were
indicated. The final run with minsize 20 created 8247 segments.
There were no errors nor warnings, and I couldn't find the i.segment script
to review it.
I also tried with a minsize of one (1). The result looks similar with even
less segments created - a total of  8160.
I tried with Grass Gis 7.6.0 and 7.6.1(download of yesterday).

Best,
Jamille
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-16 Thread Jamille Haarloo
Replacing
ids <- rownames(features)
with
ids <- rownames(predicted)
is the only edit I did after the previous try, so this should have solved
the error.

If I understood correctly na.action = na.exclude can help to work around
the NA values without deleting rows but somehow I did not work. The user
can always compare the original data rows to the results, right? As in my
case, comparing the results file to the vector file shows that 17849 of
17851 segments were classified as expected from the error. I did not loose
any original data and also saved a copy. If you mention in the manual that
intermediate na values might block the analyses and will therefore be
omitted from the final results, it should be perfectly fine.
I noticed a minor issue; not all results were added to the vector file -
about 686 segments (almost 4% of the data) were somehow missed. Fortunately
I do have the results as separate output file.

Best,
Jamille

On Tue, Apr 16, 2019 at 10:04 AM Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> On 16/04/19 14:37, Jamille Haarloo wrote:
> > Hi Moritz,
> >
> > Thank you! it worked.
>
> What worked, exactly ? ;-)
>
>
> > I did not find the line nor similar lines of 'features <-
> > na.omit(features)' in the v.class.mlR script/ R_script4 file.
>
> Sorry, I am working with a heavily modified version here on my computer
> currently, and didn't realize that this was part of my local modifications.
>
> I also see that in the manual I actually wrote "The module makes no
> effort to check the input data for NA values or anything else that might
> perturb the analyses. It is up to the user to proceed to relevant checks
> before launching the module."
>
> I could add an na.omit to the code. What is your opinion on that as a
> user ? Isn't it too invasive to just force this on the user ? I do
> acknowledge that in my local case it is convenient.
>
> Moritz
>
> >
> > Best,
> > Jamille
> >
> > On Mon, Apr 15, 2019 at 11:09 AM Moritz Lennert
> > mailto:mlenn...@club.worldonline.be>>
> wrote:
> >
> > Hi Jamille,
> >
> > On 15/04/19 14:49, Jamille Haarloo wrote:> Dear Moritz and other
> Grass-
> > users and developers,
> >   >
> >   > I tried dealing with the error myself by changing predicted <-
> >   > data.frame(predict(models.cv <http://models.cv>
> > <http://models.cv>, features)) into
> >   > predicted <- data.frame(predict(models.cv <http://models.cv>
> > <http://models.cv>, features,
> >   > na.action = na.exclude)), based on discussions online implying
> some
> >   > predictions might be invalid NaN values. I checked the script
> > output to
> >   > see if this change was implemented and it was, but I get the
> > same error.
> >   > Any suggestions what to try next?>
> >   > --
> >   > v.class.mlR -i --overwrite segments_map=nvSegW24IDM4DV4@LUP1
> >   > training_map=TrainingApril2019@LUP1
> train_class_column=class_code
> >   > output_class_column=output_class output_prob_column=probability
> >   > classifiers=svmLinear,rf,xgbTree folds=5 partitions=10
> tunelength=10
> >   > weighting_modes=bwwv,qbwwv weighting_metric=accuracy
> >   >
> >
>  
> classification_results=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\results_all_classifiers
> >
> >
> >   >
> >
>  
> accuracy_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\accuracy_classifiers
> >
> >
> >   >
> >
>  
> model_details=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\details_classifier_module_runs
> >
> >
> >   >
> >
>  
> bw_plot_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\box-whicker_classifier_performance
> >
> >
> >   >
> >
>  
> r_script_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\R_script4
> >
> >
> >   > processes=3
> > Normally, there should be no NA in the features as there is a line:
> >
> > features <- na.omit(features)
> >
> > early in the R script. Can you see it in the R_script4 file ?
> >
> >
> >   > Running R now. Following output is R output.
> >   > During startup - Warning messages:
> >   > 1: Setting LC_CTYPE=en_US.cp1252 failed
> >   > 2: Setting LC_COLLATE=en_US.cp1252 failed
> >   > 3: Setting LC_TIME=en_US.cp1252 f

Re: [GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-16 Thread Jamille Haarloo
Hi Moritz,

Thank you! it worked.

I did not find the line nor similar lines of 'features <-
na.omit(features)' in the v.class.mlR script/ R_script4 file.

Best,
Jamille

On Mon, Apr 15, 2019 at 11:09 AM Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> Hi Jamille,
>
> On 15/04/19 14:49, Jamille Haarloo wrote:> Dear Moritz and other Grass-
> users and developers,
>  >
>  > I tried dealing with the error myself by changing predicted <-
>  > data.frame(predict(models.cv <http://models.cv>, features)) into
>  > predicted <- data.frame(predict(models.cv <http://models.cv>, features,
>  > na.action = na.exclude)), based on discussions online implying some
>  > predictions might be invalid NaN values. I checked the script output to
>  > see if this change was implemented and it was, but I get the same error.
>  > Any suggestions what to try next?>
>  > --
>  > v.class.mlR -i --overwrite segments_map=nvSegW24IDM4DV4@LUP1
>  > training_map=TrainingApril2019@LUP1 train_class_column=class_code
>  > output_class_column=output_class output_prob_column=probability
>  > classifiers=svmLinear,rf,xgbTree folds=5 partitions=10 tunelength=10
>  > weighting_modes=bwwv,qbwwv weighting_metric=accuracy
>  >
> classification_results=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\results_all_classifiers
>
>
>  >
> accuracy_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\accuracy_classifiers
>
>
>  >
> model_details=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\details_classifier_module_runs
>
>
>  >
> bw_plot_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\box-whicker_classifier_performance
>
>
>  >
> r_script_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\R_script4
>
>
>  > processes=3
> Normally, there should be no NA in the features as there is a line:
>
> features <- na.omit(features)
>
> early in the R script. Can you see it in the R_script4 file ?
>
>
>  > Running R now. Following output is R output.
>  > During startup - Warning messages:
>  > 1: Setting LC_CTYPE=en_US.cp1252 failed
>  > 2: Setting LC_COLLATE=en_US.cp1252 failed
>  > 3: Setting LC_TIME=en_US.cp1252 failed
>  > 4: Setting LC_MONETARY=en_US.cp1252 failed
>  > Loading required package: caret
>  > Loading required package: lattice
>  > Loading required package: ggplot2
>  > Warning messages:
>  > 1: package 'caret' was built under R version 3.5.3
>  > 2: package 'ggplot2' was built under R version 3.5.3
>  > Loading required package: foreach
>  > Loading required package: iterators
>  > Loading required package: parallel
>  > Warning messages:
>  > 1: package 'doParallel' was built under R version 3.5.3
>  > 2: package 'foreach' was built under R version 3.5.3
>  > 3: package 'iterators' was built under R version 3.5.3
>  > During startup - Warning messages:
>  > 1: Setting LC_CTYPE=en_US.cp1252 failed
>  > 2: Setting LC_COLLATE=en_US.cp1252 failed
>  > 3: Setting LC_TIME=en_US.cp1252 failed
>  > 4: Setting LC_MONETARY=en_US.cp1252 failed
>  > During startup - Warning messages:
>  > 1: Setting LC_CTYPE=en_US.cp1252 failed
>  > 2: Setting LC_COLLATE=en_US.cp1252 failed
>  > 3: Setting LC_TIME=en_US.cp1252 failed
>  > 4: Setting LC_MONETARY=en_US.cp1252 failed
>  > During startup - Warning messages:
>  > 1: Setting LC_CTYPE=en_US.cp1252 failed
>  > 2: Setting LC_COLLATE=en_US.cp1252 failed
>  > 3: Setting LC_TIME=en_US.cp1252 failed
>  > 4: Setting LC_MONETARY=en_US.cp1252 failed
>  > Error in data.frame(id = rownames(features), predicted) :
>  >arguments imply differing number of rows: 17851, 17849
>  > Execution halted
> IDs are taken from the features and for some reasons there are two
> features which do not have a prediction. It might help if you could find
> out why.
>
> I cannot test right now, but you might want to check if you can replace
>
> ids <- rownames(features)
>
> with something like
>
> ids <- rownames(predicted)
>
> ?
>
> Moritz
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.class.mlR Error in data.frame : arguments imply differing number of rows

2019-04-15 Thread Jamille Haarloo
Dear Moritz and other Grass- users and developers,

I tried dealing with the error myself by changing predicted <-
data.frame(predict(models.cv, features)) into predicted <-
data.frame(predict(models.cv, features, na.action = na.exclude)), based on
discussions online implying some predictions might be invalid NaN values. I
checked the script output to see if this change was implemented and it was,
but I get the same error.
Any suggestions what to try next?

--
v.class.mlR -i --overwrite segments_map=nvSegW24IDM4DV4@LUP1
training_map=TrainingApril2019@LUP1 train_class_column=class_code
output_class_column=output_class output_prob_column=probability
classifiers=svmLinear,rf,xgbTree folds=5 partitions=10 tunelength=10
weighting_modes=bwwv,qbwwv weighting_metric=accuracy
classification_results=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\results_all_classifiers
accuracy_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\accuracy_classifiers
model_details=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\details_classifier_module_runs
bw_plot_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\box-whicker_classifier_performance
r_script_file=C:\Users\haarlooj\Documents\CELOS\v.class.mlr_outputapril2019\R_script4
processes=3
Running R now. Following output is R output.
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Warning messages:
1: package 'caret' was built under R version 3.5.3
2: package 'ggplot2' was built under R version 3.5.3
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
Warning messages:
1: package 'doParallel' was built under R version 3.5.3
2: package 'foreach' was built under R version 3.5.3
3: package 'iterators' was built under R version 3.5.3
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Error in data.frame(id = rownames(features), predicted) :
  arguments imply differing number of rows: 17851, 17849
Execution halted
ERROR: There was an error in the execution of the R script.
Please check the R output.
(Thu Apr 11 12:09:19 2019) Command finished (1176 min 9 sec)
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Error while executing: 'CREATE TEMPORARY TABLE...

2019-03-13 Thread Jamille Haarloo
Just tested:

(Wed Mar 13 23:42:59 2019)

v.db.dropcolumn map=nvTrainingset_new2019@LUP1
columns=Uitleg2,SegUitleg,x22kcluster,x12kcluster,x17kcluster,x8kcluster,xkcluster
ERROR: Error while executing: 'CREATE TEMPORARY TABLE
nvTrainingset_new2019_backup(cat INTEGER, compact_circle DOUBLE PRECISION,
DV2_mean DOUBLE PRECISION, DV2_stddev DOUBLE PRECISION, DV2_variance DOUBLE
PRECISION, DV2_coeff_var DOUBLE PRECISION, DV2_first_quart DOUBLE
PRECISION, DV2_median DOUBLE PRECISION, DV2_third_quart DOUBLE PRECISION,
DV2_perc_90 DOUBLE PRECISION, DV4_mean DOUBLE PRECISION, DV4_stddev DOUBLE
PRECISION, DV4_variance DOUBLE PRECISION, DV4_coeff_var DOUBLE PRECISION,
DV4_first_quart DOUBLE PRECISION, DV4_median DOUBLE PRECISION,
DV4_third_quart DOUBLE PRECISION, DV4_perc_90 DOUBLE PRECISION, IDM2_mean
DOUBLE PRECISION, IDM2_stddev DOUBLE PRECISION, IDM2_variance DOUBLE
PRECISION, IDM2_coeff_var DOUBLE PRECISION, IDM2_first_quart DOUBLE
PRECISION, IDM2_median DOUBLE PRECISION, IDM2_third_quart DOUBLE PRECISION,
IDM2_perc_90 DOUBLE PRECISION, IDM4_mean DOUBLE PRECISION, IDM4_stddev
DOUBLE PRECISION, IDM4_variance DOUBLE PRECISION, IDM4_coeff_var DOUBLE
PRECISION, IDM4_first_quart DOUBLE PRECISION, IDM4_median DOUBLE PRECISION,
IDM4_third_quart DOUBLE PRECISION, IDM4_perc_90 DOUBLE PRECISION, W2_mean
DOUBLE PRECISION, W2_stddev DOUBLE PRECISION, W2_variance DOUBLE PRECISION,
W2_coeff_var DOUBLE PRECISION, W2_first_quart DOUBLE PRECISION, W2_median
DOUBLE PRECISION, W2_third_quart DOUBLE PRECISION, W2_perc_90 DOUBLE
PRECISION, W4_mean DOUBLE PRECISION, W4_stddev DOUBLE PRECISION,
W4_variance DOUBLE PRECISION, W4_coeff_var DOUBLE PRECISION, W4_first_quart
DOUBLE PRECISION, W4_median DOUBLE PRECISION, W4_third_quart DOUBLE
PRECISION, W4_perc_90 DOUBLE PRECISION, neighbors_count DOUBLE PRECISION,
compact_circle_nbrmean DOUBLE PRECISION, compact_circle_nbrstddev DOUBLE
PRECISION, DV2_mean_nbrmean DOUBLE PRECISION, DV2_mean_nbrstddev DOUBLE
PRECISION, DV2_stddev_nbrmean DOUBLE PRECISION, DV2_stddev_nbrstddev DOUBLE
PRECISION, DV2_variance_nbrmean DOUBLE PRECISION, DV2_variance_nbrstddev
DOUBLE PRECISION, DV2_coeff_var_nbrmean DOUBLE PRECISION,
DV2_coeff_var_nbrstddev DOUBLE PRECISION, DV2_first_quart_nbrmean DOUBLE
PRECISION, DV2_first_quart_nbrstddev DOUBLE PRECISION, DV2_median_nbrmean
DOUBLE PRECISION, DV2_median_nbrstddev DOUBLE PRECISION,
DV2_third_quart_nbrmean DOUBLE PRECISION, DV2_third_quart_nbrstddev DOUBLE
PRECISION, DV2_perc_90_nbrmean DOUBLE PRECISION, DV2_perc_90_nbrstddev
DOUBLE PRECISION, DV4_mean_nbrmean DOUBLE PRECISION, DV4_mean_nbrstddev
DOUBLE PRECISION, DV4_stddev_nbrmean DOUBLE PRECISION, DV4_stddev_nbrstddev
DOUBLE PRECISION, DV4_variance_nbrmean DOUBLE PRECISION,
DV4_variance_nbrstddev DOUBLE PRECISION, DV4_coeff_var_nbrmean DOUBLE
PRECISION, DV4_coeff_var_nbrstddev DOUBLE PRECISION,
DV4_first_quart_nbrmean DOUBLE PRECISION, DV4_first_quart_nbrstddev DOUBLE
PRECISION, DV4_median_nbrmean DOUBLE PRECISION, DV4_median_nbrstddev DOUBLE
PRECISION, DV4_third_quart_nbrmean DOUBLE PRECISION,
DV4_third_quart_nbrstddev DOUBLE PRECISION, DV4_perc_90_nbrmean DOUBLE
PRECISION, DV4_perc_90_nbrstddev DOUBLE PRECISION, IDM2_mean_nbrmean DOUBLE
PRECISION, IDM2_mean_nbrstddev DOUBLE PRECISION, IDM2_stddev_nbrmean DOUBLE
PRECISION, IDM2_stddev_nbrstddev DOUBLE PRECISION, IDM2_variance_nbrmean
DOUBLE PRECISION, IDM2_variance_nbrstddev DOUBLE PRECISION,
IDM2_coeff_var_nbrmean DOUBLE PRECISION, IDM2_coeff_var_nbrstddev DOUBLE
PRECISION, IDM2_first_quart_nbrmean DOUBLE PRECISION,
IDM2_first_quart_nbrstddev DOUBLE PRECISION, IDM2_median_nbrmean DOUBLE
PRECISION, IDM2_median_nbrstddev DOUBLE PRECISION, IDM2_third_quart_nbrmean
DOUBLE PRECISION, IDM2_third_quart_nbrstddev DOUBLE PRECISION,
IDM2_perc_90_nbrmean DOUBLE PRECISION, IDM2_perc_90_nbrstddev DOUBLE
PRECISION, IDM4_mean_nbrmean DOUBLE PRECISION, IDM4_mean_nbrstddev DOUBLE
PRECISION, IDM4_stddev_nbrmean DOUBLE PRECISION, IDM4_stddev_nbrstddev
DOUBLE PRECISION, IDM4_variance_nbrmean DOUBLE PRECISION,
IDM4_variance_nbrstddev DOUBLE PRECISION, IDM4_coeff_var_nbrmean DOUBLE
PRECISION, IDM4_coeff_var_nbrstddev DOUBLE PRECISION,
IDM4_first_quart_nbrmean DOUBLE PRECISION, IDM4_first_quart_nbrstddev
DOUBLE PRECISION, IDM4_median_nbrmean
DOUBLE PRECISION, IDM4_median_nbrstddev DOUBLE PRECIS'
ERROR: Deleting column failed

On Fri, Mar 8, 2019 at 4:25 PM Markus Metz 
wrote:

>
>
> On Thu, Mar 7, 2019 at 6:35 PM Markus Neteler  wrote:
> >
> > Hi,
> >
> > On Sat, Feb 16, 2019 at 12:28 AM Jamille Haarloo 
> wrote:
> > >
> > > Dear Grass community,
> > >
> > > I don't have any success with removal of columns from a vector file I
> am working with, while adding columns has not been a problem.
> > >
> > > output:
> > > v.db.dropcolumn map=nvTrainingset_test2019_clean@LUP1 columns=code
> > > ERROR: Error while executing: 'CREATE TEMPORARY TABLE
> nvTrainingset_test2019_c

[GRASS-user] Error while executing: 'CREATE TEMPORARY TABLE...

2019-02-15 Thread Jamille Haarloo
Dear Grass community,

I don't have any success with removal of columns from a vector file I am
working with, while adding columns has not been a problem.

output:
v.db.dropcolumn map=nvTrainingset_test2019_clean@LUP1 columns=code

ERROR: Error while executing: 'CREATE TEMPORARY TABLE
nvTrainingset_test2019_clean_backup(cat INTEGER, compact_circle DOUBLE
PRECISION, DV2_mean DOUBLE PRECISION, DV2_stddev DOUBLE PRECISION,
DV2_variance DOUBLE PRECISION, DV2_coeff_var DOUBLE PRECISION,
DV2_first_quart DOUBLE PRECISION, DV2_median DOUBLE PRECISION,
DV2_third_quart DOUBLE PRECISION, DV2_perc_90 DOUBLE PRECISION, DV4_mean
DOUBLE PRECISION, DV4_stddev DOUBLE PRECISION, DV4_variance DOUBLE
PRECISION, DV4_coeff_var DOUBLE PRECISION, DV4_first_quart DOUBLE
PRECISION, DV4_median DOUBLE PRECISION, DV4_third_quart DOUBLE PRECISION,
DV4_perc_90 DOUBLE PRECISION, IDM2_mean DOUBLE PRECISION, IDM2_stddev
DOUBLE PRECISION, IDM2_variance DOUBLE PRECISION, IDM2_coeff_var DOUBLE
PRECISION, IDM2_first_quart DOUBLE PRECISION, IDM2_median DOUBLE PRECISION,
IDM2_third_quart DOUBLE PRECISION, IDM2_perc_90 DOUBLE PRECISION, IDM4_mean
DOUBLE PRECISION, IDM4_stddev DOUBLE PRECISION, IDM4_variance DOUBLE
PRECISION, IDM4_coeff_var DOUBLE PRECISION, IDM4_first_quart DOUBLE
PRECISION, IDM4_median DOUBLE PRECISION, IDM4_third_quart DOUBLE PRECISION,
IDM4_perc_90 DOUBLE PRECISION, W2_mean DOUBLE PRECISION, W2_stddev DOUBLE
PRECISION, W2_variance DOUBLE PRECISION, W2_coeff_var DOUBLE PRECISION,
W2_first_quart DOUBLE PRECISION, W2_median DOUBLE PRECISION, W2_third_quart
DOUBLE PRECISION, W2_perc_90 DOUBLE PRECISION, W4_mean DOUBLE PRECISION,
W4_stddev DOUBLE PRECISION, W4_variance DOUBLE PRECISION, W4_coeff_var
DOUBLE PRECISION, W4_first_quart DOUBLE PRECISION, W4_median DOUBLE
PRECISION, W4_third_quart DOUBLE PRECISION, W4_perc_90 DOUBLE PRECISION,
neighbors_count DOUBLE PRECISION, compact_circle_nbrmean DOUBLE PRECISION,
compact_circle_nbrstddev DOUBLE PRECISION, DV2_mean_nbrmean DOUBLE
PRECISION, DV2_mean_nbrstddev DOUBLE PRECISION, DV2_stddev_nbrmean DOUBLE
PRECISION, DV2_stddev_nbrstddev DOUBLE PRECISION, DV2_variance_nbrmean
DOUBLE PRECISION, DV2_variance_nbrstddev DOUBLE PRECISION,
DV2_coeff_var_nbrmean DOUBLE PRECISION, DV2_coeff_var_nbrstddev DOUBLE
PRECISION, DV2_first_quart_nbrmean DOUBLE PRECISION,
DV2_first_quart_nbrstddev DOUBLE PRECISION, DV2_median_nbrmean DOUBLE
PRECISION, DV2_median_nbrstddev DOUBLE PRECISION, DV2_third_quart_nbrmean
DOUBLE PRECISION, DV2_third_quart_nbrstddev DOUBLE PRECISION,
DV2_perc_90_nbrmean DOUBLE PRECISION, DV2_perc_90_nbrstddev DOUBLE
PRECISION, DV4_mean_nbrmean DOUBLE PRECISION, DV4_mean_nbrstddev DOUBLE
PRECISION, DV4_stddev_nbrmean DOUBLE PRECISION, DV4_stddev_nbrstddev DOUBLE
PRECISION, DV4_variance_nbrmean DOUBLE PRECISION, DV4_variance_nbrstddev
DOUBLE PRECISION, DV4_coeff_var_nbrmean DOUBLE PRECISION,
DV4_coeff_var_nbrstddev DOUBLE PRECISION, DV4_first_quart_nbrmean DOUBLE
PRECISION, DV4_first_quart_nbrstddev DOUBLE PRECISION, DV4_median_nbrmean
DOUBLE PRECISION, DV4_median_nbrstddev DOUBLE PRECISION,
DV4_third_quart_nbrmean DOUBLE PRECISION, DV4_third_quart_nbrstddev DOUBLE
PRECISION, DV4_perc_90_nbrmean DOUBLE PRECISION, DV4_perc_90_nbrstddev
DOUBLE PRECISION, IDM2_mean_nbrmean DOUBLE PRECISION, IDM2_mean_nbrstddev
DOUBLE PRECISION, IDM2_stddev_nbrmean DOUBLE PRECISION,
IDM2_stddev_nbrstddev DOUBLE PRECISION, IDM2_variance_nbrmean DOUBLE
PRECISION, IDM2_variance_nbrstddev DOUBLE PRECISION, IDM2_coeff_var_nbrmean
DOUBLE PRECISION, IDM2_coeff_var_nbrstddev DOUBLE PRECISION,
IDM2_first_quart_nbrmean DOUBLE PRECISION, IDM2_first_quart_nbrstddev
DOUBLE PRECISION, IDM2_median_nbrmean DOUBLE PRECISION,
IDM2_median_nbrstddev DOUBLE PRECISION, IDM2_third_quart_nbrmean DOUBLE
PRECISION, IDM2_third_quart_nbrstddev DOUBLE PRECISION,
IDM2_perc_90_nbrmean DOUBLE PRECISION, IDM2_perc_90_nbrstddev DOUBLE
PRECISION, IDM4_mean_nbrmean DOUBLE PRECISION, IDM4_mean_nbrstddev DOUBLE
PRECISION, IDM4_stddev_nbrmean DOUBLE PRECISION, IDM4_stddev_nbrstddev
DOUBLE PRECISION, IDM4_variance_nbrmean DOUBLE PRECISION,
IDM4_variance_nbrstddev DOUBLE PRECISION, IDM4_coeff_var_nbrmean DOUBLE
PRECISION, IDM4_coeff_var_nbrstddev DOUBLE PRECISION,
IDM4_first_quart_nbrmean DOUBLE PRECISION, IDM4_first_quart_nbrstddev
DOUBLE PRECISION, IDM4_median_n
brmean DOUBLE PRECISION, IDM4_median_nbrstddev DOUBLE'
ERROR: Deleting column failed

Any suggestions?
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Incomplete attribute table showing after using v.select

2019-02-12 Thread Jamille Haarloo
Dear GRASS community,

The past few weeks I created a Grass vector file consisting of points by
visually interpreting objects. This was used as input vector for
v.select in order to extract segments from another vector map which
resulted from a previous i.segment and i.segment.stats run. Then I created
a copy of the points and of the selected segments as back-up using the
g.copy command.
After my next step using v.what.vect to extract attribute data
(descriptions and class codes) from the points to the segments, I noticed
not all data was extracted. Only 26 of the 278 segments obtained attribute
data. When checking the original file and the copy with the interpreted
points, only 30 records were showing (loading), while the metadata says
there should be 375 points.
The difference between 375 points and 278 segments can be explained by a
big probability that multiple points are overlapped by 1 segment. Likewise
for the difference between 30 and 26.
However, I don't have an explanation for the big difference between the 30
showing/loading rows and the 375 points that should be present according to
the metadata. Also, from the >10 interpreted classes only 2 types are still
represented when showing the attribute table. I assume there is a database
error, but there weren't any error notifications in the command output.

Is there anyway of obtaining or restoring the attribute data?

Best,
Jamille
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Vector points behaving strangely after using v.what.vect

2018-11-06 Thread Jamille Haarloo
Hello all,

I created a vector points map in Grass with information on ecosystem
characteristics based on various sources. This was to be used as input to
create a training-set of a vector segment map with statistics for
classification.
I tried to copy the cat- values of the segments to the points- map based on
location as intermediate step by using v.what.vect. But this was not
successful - Not all cat- values of the points vector map was updated,
about 70% was. I tried then to update another (empty) column with the
segment cat-values which also worked partially - it worked for most of the
remaining which is about 25% of the total records and for non of the 70%.
Now I notice that the records of the updated cat-values are behaving
strangely. I can see the points in the map display, but if I highlight them
in the table they are not highlighted in the map display. When I click to
zoom to highlighted feature, I end-up somewhere else where it shouldn't be.
Also when I try to extract, copy or export the data, there seems to be
disconnect between the attribute values and the location of the points.
This happens with the ones of which the cat-values was updated, about 70%
of the records. When simply displayed, without other operations, it looks
fine and complete.

Is there a way to repair this disconnect?

Best,
Jamille
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-18 Thread Jamille Haarloo
I thought I did a few times, as it also was successful on Tuesday (without
the coefficient of variation and without neighborhood statistics).
After the error from Wed Oct 17 13:55, I reinstalled to be sure and
retried.
Success!! Thanks alot. Now for the next challenge to begin :)

i.segment.stats -n --overwrite map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1
,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=C:\Users\haarlooj\nStats_SegW24IDM4DV4_17okt18
vectormap=nvSegW24IDM4DV4 processes=2
Calculating geometry statistics...
Calculating statistics for raster maps...
Calculating neighborhood statistics...
Creating output vector map...
(Wed Oct 17 18:22:33 2018) Command finished (95 min 6 sec)


On Thu, Oct 18, 2018 at 5:12 AM Moritz Lennert 
wrote:

> On 17/10/18 19:15, Jamille Haarloo wrote:
> > Yes, I noticed as other modules weren't working either. Stupid..
> >
> > Just got the results with 7.6 and some "nan" values again.
>
> This shouldn't happen with the current version. Did you reinstall with
> 'g.extension i.segment.stats' ?
>
> Moritz
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-17 Thread Jamille Haarloo
Yes, I noticed as other modules weren't working either. Stupid..

Just got the results with 7.6 and some "nan" values again.

Calculating geometry statistics...
Calculating statistics for raster maps...
Calculating neighborhood statistics...
Creating output vector map...
ERROR: Error while executing: 'INSERT INTO segmstat_tmp_vect_8116 VALUES
(2744,
10.574609,0.000657937002497415,100.010348629312,0.0118722,0.0199653,0.037037,0.0532407,0.0149315167004704,-34.81817527835,-0.440972,-0.375,-0.315972,-0.232639,0.0147358775257243,26.7103955510257,0.370735,0.452658,0.53125,0.60625,0.00759147152076699,10.6500844056518,0.75,0.802083,0.875,0.927083,4.16169760046326,52.4687741848501,2,3,5,7,0.200221189871832,35.183683942494,1,1,2,2,8,13.216384625,8.62095260592,0.00227423524743,0.00305950083943,223.15170811,122.713529331,0.01689609075,0.0219202839649,0.022322058,0.0229396651236,0.029157736625,0.0250281412368,0.03936146125,0.0291593758381,0.00809150063926,0.00998894786878,nan,nan,0.000935102375,0.00149429712142,0.00332539875,0.00553672330287,0.0106704025,0.0177514942977,0.0168798225,0.0277037009502,0.0108558662204,0.00624210011282,36.7678730965,22.2897752507,0.29285125,0.180951460467,0.3513889,0.181596981702,0.41656925,0.180382131329,0.485690125,0.1830333289,0.0149007045801,0.018570035777,30.2038217327,26.3183888064,0.5921816125,0.417141476181,0.642181,0.380369094661,0.699914125,0.345038582134,0.744641,0.31679767,194.55742,313.451777334,43.4071398819,21.8790138711,15.0,20.8086520467,20.25,27.6258484033,25.875,34.2798683632,32.375,41.9402476745,164.772935658,278.214855266,39.6227650243,32.7809091847,12.375,19.1307180994,16.25,25.5673131166,21.0,32.3921286735,26.875,40.3622270818)'
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 371, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 358, in main
gscript.run_command('db.execute', input=insert_sql,
quiet=True)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 423, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', '--q', 'input=Z:\\GRASS_GIS\\Cottica_LUP\\LUP
1\\.tmp/unknown\\8116.1'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Wed Oct 17 13:55:43 2018) Command finished (90 min 41 sec)



On Wed, Oct 17, 2018 at 1:48 PM Moritz Lennert 
wrote:

> On 17/10/18 15:39, Jamille Haarloo wrote:
> > Alright. Just tried, but got an old error back again. Also when
> > reinstalling r.object.geometry got 'ERROR: File is not a zip file'
> >
> > i.segment.stats -n map=SegW24IDM4DV4@LUP1
> > rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >
> raster_statistics=variance,coeff_var,first_quart,median,third_quart,perc_90
> > area_measures=compact_circle csvfile=Z:\nStats_SegW24IDM4DV4_17okt18
> > vectormap=nvSegW24IDM4DV4 processes=4
> > Calculating geometry statistics...
> > Traceback (most recent call last):
> >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.stats.py <http://i.segment.stats.py>", line 371, in
> 
> >  main()
> >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.stats.py <http://i.segment.stats.py>", line 220, in main
> >  quiet=True)
> >File "C:\PROGRA~1\QGIS21~1.0\apps\grass\grass-7.0.4\etc\py
> > thon\grass\script\core.py", line 395, in run_command
> >  return handle_errors(returncode, returncode, args,
> > kwargs)
> >File "C:\PROGRA~1\QGIS21~1.0\apps\grass\grass-7.0.4\etc\py
> > thon\grass\script\core.py", line 313, in handle_errors
> >  returncode=returncode)
> > grass.exceptions.CalledModuleError: Module run None
> > ['r.object.geometry', '--o', '--q',
> > 'output=Z:\\GRASS_GIS/Cottica_LUP/LUP1/.tmp/unknown/7508.0',
> > 'input=SegW24IDM4DV4@LUP1'] ended with error
> > Process ended with non-zero return code -1073741515. See
> > errors in the (error) output.
> > (Wed Oct 17 10:33:05 2018) Command finished (0 sec)
> >
> > g.extension r.object.geometry
> > WARNING: Extension  already installed.
> Re-installing...
> > Downloading precompiled GRASS Addons ...
> > ERROR: File is not a zip file:
> >
> http://wingrass.fsv.cvut.cz/grass70/x86_64/addons/grass-7.0.4/r.object.geometry.zip
> > (Wed Oct 17 10:32:54 2018) Command finished (1 sec)
>
> You seem to 

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-17 Thread Jamille Haarloo
Alright. Just tried, but got an old error back again. Also when
reinstalling r.object.geometry got 'ERROR: File is not a zip file'

i.segment.stats -n map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1,DV4@LUP1
,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle csvfile=Z:\nStats_SegW24IDM4DV4_17okt18
vectormap=nvSegW24IDM4DV4 processes=4
Calculating geometry statistics...
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 371, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 220, in main
quiet=True)
  File "C:\PROGRA~1\QGIS21~1.0\apps\grass\grass-7.0.4\etc\py
thon\grass\script\core.py", line 395, in run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\PROGRA~1\QGIS21~1.0\apps\grass\grass-7.0.4\etc\py
thon\grass\script\core.py", line 313, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['r.object.geometry', '--o', '--q',
'output=Z:\\GRASS_GIS/Cottica_LUP/LUP1/.tmp/unknown/7508.0',
'input=SegW24IDM4DV4@LUP1'] ended with error
Process ended with non-zero return code -1073741515. See
errors in the (error) output.
(Wed Oct 17 10:33:05 2018) Command finished (0 sec)

g.extension r.object.geometry

WARNING: Extension  already installed. Re-installing...
Downloading precompiled GRASS Addons ...
ERROR: File is not a zip file:
http://wingrass.fsv.cvut.cz/grass70/x86_64/addons/grass-7.0.4/r.object.geometry.zip
(Wed Oct 17 10:32:54 2018) Command finished (1 sec)

On Wed, Oct 17, 2018 at 4:38 AM Moritz Lennert 
wrote:

> On 16/10/18 22:20, Jamille Haarloo wrote:
> > The csv looks ok, but quite extensive and heavy.
>
> Yes, but when dealing with large areas, not going through the vector
> fomat actually speeds up the process. You can feed this csv into
> v.class.mlR directly.
>
> > I reinstalled again and tried with less variables, without the
> > coefficient of variation and without neighborhood statistics. This time
> > without error.
>
> Great. I see that the i.segment.stats now has been updated on the addons
> server, so it would be great if you could try again with the
> neighborhood statistics.
>
> Moritz
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-16 Thread Jamille Haarloo
The csv looks ok, but quite extensive and heavy.
I reinstalled again and tried with less variables, without the coefficient
of variation and without neighborhood statistics. This time without error.

i.segment.stats map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1
,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=variance,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_16okt18
vectormap=vSegW24IDM4DV4 processes=3
Calculating geometry statistics...
Calculating statistics for raster maps...
Creating output vector map...
(Tue Oct 16 16:31:51 2018) Command finished (94 min 7 sec)



On Tue, Oct 16, 2018 at 1:56 PM Moritz Lennert 
wrote:

> On 15/10/18 21:00, Jamille Haarloo wrote:
> > I did with neighborhood statistics and vector, and without.
> >
> > with neighb. statistics & with vector
> > i.segment.stats -n --overwrite map=SegW24IDM4DV4@LUP1
> > rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
>
> > area_measures=compact_circle
> > csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18
> > vectormap=vSegW24IDM4DV4 processes=3
> > Calculating geometry statistics...
> > Calculating statistics for raster maps...
> > Calculating neighborhood statistics...
> > Creating output vector map...
> > DBMI-SQLite driver error:
> > Error in sqlite3_prepare():
> > near "IDM4_third_qu": syntax error
> > ERROR: Error while executing: 'CREATE TABLE segmstat_tmp_vect_10260 (cat
> > int, compact_circle double precision, DV2_mean double precision,
> > DV2_stddev double precision, DV2_variance double precision,
> > DV2_coeff_var double precision, DV2_first_quart double precision,
> > DV2_median double precision, DV2_third_quart double precision,
> > DV2_perc_90 double precision, DV4_mean double precision, DV4_stddev
> [...]
>
> This is not using the new version of i.segment.stats that I committed
> yesterday. I see that the version available at
> https://wingrass.fsv.cvut.cz/grass74/x86_64/addons/latest/ is still the
> one from before my changes.
>
> Martin, any reason this has not been recreated since ?
>
>
> > without neighb. statistics, but with vector
> > (Mon Oct 15 10:54:02 2018)
> > i.segment.stats --overwrite map=SegW24IDM4DV4@LUP1
> > rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
>
> > area_measures=compact_circle
> > csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18
> > vectormap=vSegW24IDM4DV4 processes=3
> > Calculating geometry statistics...
> > Calculating statistics for raster maps...
> > Creating output vector map...
> > DBMI-SQLite driver error:
> > Error in sqlite3_prepare():
> > no such column: nan
> > DBMI-SQLite driver error:
> > Error in sqlite3_prepare():
> > no such column: nan
> > ERROR: Error while executing: 'INSERT INTO segmstat_tmp_vect_3516 VALUES
> > (1244,
> >
> 1.128379,0.069477558136,0,0,0,0.069,0.069,0.069,0.069,0,0,0,nan,0,0,0,0,0.53125,0,0,0,0.53125,0.53125,0.53125,0.53125,1,0,0,0,1,1,1,1,3,0,0,0,3,3,3,3,1,0,0,0,1,1,1,1)'
>
> Hmmm, not sure where this 'nan' comes from. If I see correctly it is
> from a coefficient of variation of DV4@LUP1 for an object where both the
> mean and the stddev are 0, leading to a zero division.
>
> I don't know what DV4 is. Is it normal that an object could have mean
> and stddev = 0 ? If yes, then the coefficient of variation might not be
> useful.
>
> Anyhow, I just committed a fix (r73555) which should normally replace
> this 'nan' by its SQL equivalent 'NULL'.
>
> >
> > without neighb. statistics & without vector
> > (Mon Oct 15 14:58:40 2018)
> > i.segment.stats --overwrite map=SegW24IDM4DV4@LUP1
> > rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
>
> > area_measures=compact_circle
> > csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18b processes=3
> > Calculating geometry statistics...
> > Calculating statistics for raster maps...
> > (Mon Oct 15 15:15:18 2018) Command finished (16 min 38 sec)
> >
> > with neighb. statistics, but without vector
> > (Mon Oct 15 15:32:39 2018)
> > i.segment.stats -n --overwrite map=SegW24IDM4DV4@LUP1
> > rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,per

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-15 Thread Jamille Haarloo
s/scri
pts/i.segment.stats.py", line 371, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 358, in main
gscript.run_command('db.execute', input=insert_sql,
quiet=True)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 423, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', '--q', 'input=Z:\\GRASS_GIS\\Cottica_LUP\\LUP
1\\.tmp/unknown\\10260.1'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Mon Oct 15 09:54:33 2018) Command finished (81 min 46 sec)


without neighb. statistics, but with vector
(Mon Oct 15 10:54:02 2018)

i.segment.stats --overwrite map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1,DV4@LUP1
,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18
vectormap=vSegW24IDM4DV4 processes=3
Calculating geometry statistics...
Calculating statistics for raster maps...
Creating output vector map...
DBMI-SQLite driver error:
Error in sqlite3_prepare():
no such column: nan
DBMI-SQLite driver error:
Error in sqlite3_prepare():
no such column: nan
ERROR: Error while executing: 'INSERT INTO segmstat_tmp_vect_3516 VALUES
(1244,
1.128379,0.069477558136,0,0,0,0.069,0.069,0.069,0.069,0,0,0,nan,0,0,0,0,0.53125,0,0,0,0.53125,0.53125,0.53125,0.53125,1,0,0,0,1,1,1,1,3,0,0,0,3,3,3,3,1,0,0,0,1,1,1,1)'
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 371, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 358, in main
gscript.run_command('db.execute', input=insert_sql,
quiet=True)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 423, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', '--q', 'input=Z:\\GRASS_GIS\\Cottica_LUP\\LUP
1\\.tmp/unknown\\3516.1'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Mon Oct 15 12:17:00 2018) Command finished (82 min 57 sec)


without neighb. statistics & without vector
(Mon Oct 15 14:58:40 2018)

i.segment.stats --overwrite map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1,DV4@LUP1
,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18b processes=3
Calculating geometry statistics...
Calculating statistics for raster maps...
(Mon Oct 15 15:15:18 2018) Command finished (16 min 38 sec)


with neighb. statistics, but without vector
(Mon Oct 15 15:32:39 2018)

i.segment.stats -n --overwrite map=SegW24IDM4DV4@LUP1 rasters=DV2@LUP1
,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_15okt18c processes=3
Calculating geometry statistics...
Calculating statistics for raster maps...
Calculating neighborhood statistics...
(Mon Oct 15 15:50:25 2018) Command finished (17 min 46 sec)



On Mon, Oct 15, 2018 at 6:18 AM Moritz Lennert 
wrote:

> On 15/10/18 10:54, Moritz Lennert wrote:
> > On 15/10/18 10:17, Moritz Lennert wrote:
> >> On 12/10/18 21:10, Jamille Haarloo wrote:
> >>> Markus. i.segment finished without giving an error.
> >>>
> >>> Moritz,
> >>> I am back at the older error. I've seen this error documented online as
> >>> a result of 'unaccepted' column-names. I tried to keep the name of the
> >>> input maps for the statistics as short and simple possible (without
> dots
> >>> etc).
> >>>
> >>> i.segment.stats -n map=SegW24IDM4DV4@LUP1
> >>> rasters=DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
> >>>
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
> >>> area_measures=compact_circle
> >>> csvfile=C:\Users\haarlooj\Stats_SegW24IDM4DV4_11okt18
> >>> vectormap=vSegW24IDM4DV4 processes=2
> >>> Calculating geometry statistics...
> >>> Calculating statistics for raster maps...
> >>> Calculating neighborh

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-12 Thread Jamille Haarloo
ean
double precision, IDM4_median_nbrstddev double precision, IDM4_third_qu'
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 370, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 357, in main
gscript.run_command('db.execute', input=insert_sql,
quiet=True)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 423, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', '--q', 'input=Z:\\GRASS_GIS\\Cottica_LUP\\LUP
1\\.tmp/unknown\\12816.1'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Thu Oct 11 18:33:18 2018) Command finished (99 min 25 sec)


On Thu, Oct 11, 2018 at 4:23 PM Moritz Lennert 
wrote:

> On 11/10/18 19:42, Jamille Haarloo wrote:
> > Markus, that's great! I will install the latest version and retry. I
> > will report next Monday.
> >
> > Thanks Moritz. The spaces and '&' in paths of output files did not give
> > problems before, but I retried without the spaces and '&' just in case.
> > i.segment.stats -n --overwrite map=SegmW24IDM4DV4@LUP1
> > rasters=W2@LUP1,W4@LUP1,DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1
> >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
>
> > area_measures=compact_circle
> > csvfile=Z:\grass_cmd_output-i.segment.statsSegmWV24IDM4DV4_11okt2018.txt
> > vectormap=VSegmWV24IDM4DV4 processes=4
> > Calculating geometry statistics...
> > Calculating statistics for raster maps...
> > Calculating neighborhood statistics...
> > Traceback (most recent call last):
> >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.stats.py <http://i.segment.stats.py>", line 370, in
> 
> >  main()
> >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.stats.py <http://i.segment.stats.py>", line 282, in main
> >  quiet=True).splitlines()])
> >File "C:\Program Files\GRASS GIS
> > 7.6.svn\etc\python\grass\script\core.py", line 478, in
> > read_command
> >  return handle_errors(returncode, stdout, args, kwargs)
> >File "C:\Program Files\GRASS GIS
> > 7.6.svn\etc\python\grass\script\core.py", line 334, in
> > handle_errors
> >  returncode=returncode)
> > grass.exceptions.CalledModuleError: Module run None
> > ['r.neighborhoodmatrix', '--q', '-d',
> > 'input=SegmW24IDM4DV4@LUP1'] ended with error
>
> Try reinstalling r.neighborhoodmatrix with g.extension.
>
> Moritz
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-11 Thread Jamille Haarloo
Markus, that's great! I will install the latest version and retry. I will
report next Monday.

Thanks Moritz. The spaces and '&' in paths of output files did not give
problems before, but I retried without the spaces and '&' just in case.

i.segment.stats -n --overwrite map=SegmW24IDM4DV4@LUP1 rasters=W2@LUP1
,W4@LUP1,DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle
csvfile=Z:\grass_cmd_output-i.segment.statsSegmWV24IDM4DV4_11okt2018.txt
vectormap=VSegmWV24IDM4DV4 processes=4
Calculating geometry statistics...
Calculating statistics for raster maps...
Calculating neighborhood statistics...
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 370, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 282, in main
quiet=True).splitlines()])
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 478, in
read_command
return handle_errors(returncode, stdout, args, kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['r.neighborhoodmatrix', '--q', '-d',
'input=SegmW24IDM4DV4@LUP1'] ended with error
Process ended with non-zero return code -1073741515. See
errors in the (error) output.
(Thu Oct 11 13:30:10 2018) Command finished (15 min 56 sec)

Hopefully it works on Monday!

On Wed, Oct 10, 2018 at 5:46 AM Moritz Lennert 
wrote:

> On 09/10/18 17:19, Jamille Haarloo wrote:
> > first lines of test.csv
> >
> > cat|area|perimeter|compact_square|compact_circle|fd
> > 1|11876.00|1398.00|0.311808|3.618821|1.543932
> > 2|635805.00|57572.00|0.055400|20.367814|1.640512
> > 3|25898.00|3322.00|0.193773|5.823198|1.595825
> > 4|7767.00|1702.00|0.207122|5.447885|1.661054
> > 5|13605.00|2200.00|0.212074|5.320696|1.617158
> > 6|442366.00|44230.000000|0.060150|18.759495|1.645730
> >
>
> So everything looks alright.
>
> However:
>
> On 08/10/18 20:40, Jamille Haarloo wrote:
>  > i.segment.stats -n map=SegmW24IDM4DV4@LUP1
>  > rasters=W2@LUP1,W4@LUP1,DV2@LUP1,DV4@LUP1,IDM2@LUP1,IDM4@LUP1
>  >
> raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
>
>
>  > area_measures=compact_circle csvfile=X:\Projecten\Land-use Planning
>  > Marowijne\GIS en RS\Werkfolder\GRASS &
>  > R\grass_cmd_output-i.segment.statsSegmWV24IDM4DV4_5okt2018.txt
>  > vectormap=VSegmWV24IDM4DV4 processes=4
>
> I'm not sure how well the script can handle a file path with spaces and
> '&' in it. Maybe this causes some error ?
>
>  > Calculating geometry statistics...
>  > Traceback (most recent call last):
>  >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
>  > pts/i.segment.stats.py <http://i.segment.stats.py>", line 370, in
> 
>  >  main()
>  >File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
>  > pts/i.segment.stats.py <http://i.segment.stats.py>", line 219, in main
>  >  quiet=True)
>  >File "C:\Program Files\GRASS GIS
>  > 7.6.svn\etc\python\grass\script\core.py", line 423, in
>  > run_command
>  >  return handle_errors(returncode, returncode, args,
>  > kwargs)
>  >File "C:\Program Files\GRASS GIS
>  > 7.6.svn\etc\python\grass\script\core.py", line 334, in
>  > handle_errors
>  >  returncode=returncode)
>  > grass.exceptions.CalledModuleError: Module run None
>  > ['r.object.geometry', '--o', '--q', 'output=Z:\\GRASS_GIS\\C
>  > ottica_LUP\\LUP1\\.tmp/unknown\\10956.0',
>  > 'input=SegmW24IDM4DV4@LUP1'] ended with error
>  > Process ended with non-zero return code -1073741515. See
>  > errors in the (error) output.
>
> The error message does not tell us what went wrong with
> r.object.geometry. Have you tried running i.segment.stats since
> reinstalling r.object.geometry ?
>
> Moritz
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-09 Thread Jamille Haarloo
first lines of test.csv

cat|area|perimeter|compact_square|compact_circle|fd
1|11876.00|1398.00|0.311808|3.618821|1.543932
2|635805.00|57572.00|0.055400|20.367814|1.640512
3|25898.00|3322.00|0.193773|5.823198|1.595825
4|7767.00|1702.00|0.207122|5.447885|1.661054
5|13605.00|2200.00|0.212074|5.320696|1.617158
6|442366.00|44230.00|0.060150|18.759495|1.645730

--
Windows 7
Dell
Proc. Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
RAM: 16 GB
--
Could the "ju" be caused my the Mask?
--
I used uspo on 3 regions to decide on parameters. 0.24 as treshold and
minsize 3500 looked to be the best combination of parameters studying all
the results in the output file.
Summary:
regions=regionAB@LUP1,regionD@LUP1,regionRM@LUP1
segmentation_method=region_growing threshold_start=0.18 threshold_stop=0.25
threshold_step=0.02 minsize_start=3000 minsize_stop=6000 minsize_step=500
optimization_function=f number_best=2 memory=8000 processes=4
Working on region regionAB@LUP1
Working on region regionD@LUP1
Working on region regionRM@LUP1
Best values:
Region Thresh Minsize Optimization
regionRM@LUP1 0.24 3500 0.7951456323
regionRM@LUP1 0.24 3000 0.765849594003
regionAB@LUP1 0.24 4000 0.630706501774
regionAB@LUP1 0.24 3500 0.472619083853
regionD@LUP1 0.2 3000 0.802618475115
regionD@LUP1 0.22 3000 0.77939730321

I also had other uspo runs but with less useful results.

The map with segments was created (0.24 treshold minsize 3500). But after
the errors with i.segment.stats I reasoned the number of segments (18685)
was too much to handle as it failed to create the attribute table. To
reduce the number of segments, I used this map as seed to create a new
segmentation map with the parameters 0.25 and 5000 and a mask to eliminate
the matrix.
But now I see the number of segments shouldn't have been a problem in this
case.

On Tue, Oct 9, 2018 at 9:35 AM Moritz Lennert 
wrote:

> On 09/10/18 13:48, Jamille Haarloo wrote:
> > Hello Moritz,
> >
> > First a pop-up came about not finding it, so reinstalled it.
> >
> > g.extension r.object.geometry
> > WARNING: Extension  already installed.
> Re-installing...
> > Downloading precompiled GRASS Addons ...
> > Updating addons metadata file...
> > Installation of  successfully finished
> > (Mon Oct 08 16:55:04 2018) Command finished (4 sec)
> > (Mon Oct 08 16:55:53 2018)
> > r.object.geometry SegmW24IDM4DV4 output=test.csv
> > Calculating statistics
> > Writing output
> > (Mon Oct 08 16:56:14 2018) Command finished (21 sec)
>
> Could you provide the first lines of content of test.csv ?
>
> >
> > g.region -p
> > projection: 1 (UTM)
> > zone:   21
> > datum:  wgs84
> > ellipsoid:  wgs84
> > north:  634826.41313284
> > south:  611477.61329757
> > west:   775494.11663193
> > east:   793630.22784822
> > nsres:  0.5642
> > ewres:  0.5307
> > rows:   46697
> > cols:   36272
> > cells:  1693793584
>
>
> So you have over 1.5 billion cells. That's quite big, but not impossible
> to handle. Depends on your machine.
>
> >
> > r.info <http://r.info> SegmW24IDM4DV4
> >
>  
> ++
> >   | Map:  SegmW24IDM4DV4 Date: Fri Oct 05 23:46:04
> > 2018|
> >   | Mapset:   LUP1   Login of Creator: haarlooj
> >|
> >   | Location: Cottica_LUP
> >|
> >   | DataBase: Z:\GRASS_GIS
> > |
> >   | Title:
> > |
> >   | Timestamp: none
> >|
> >
>  
> ||
> >   |
> >|
> >   |   Type of Map:  raster   Number of Categories: 0
> > |
> >   |   Data Type:CELL
> > |
> >   |   Rows: 46697
> >|
> >   |   Columns:  36272
> >|
> >   |   Total Cells:  ju
>
>
> This 'ju' is weird, here.
>
>
> > |
> >   |Projection: UTM (zone 21)
> > |
> >   |N: 634826.41313284S: 611477.61329757   Res:
> > 0.5642  |
> >   |E: 793630.22784822W: 775494.11663193   Res:
> > 0.5307  |
> >   |   Range of data:min = 1  max = 12901
> > |
> >   |
> >|
> >   |   Data Description:
> >|
> >   |generated by i.segment
> >|
> >   |
> >|
> >   |   Comments:
> >|
> >   |i.segment --ov

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-09 Thread Jamille Haarloo
Hello Moritz,

First a pop-up came about not finding it, so reinstalled it.

g.extension r.object.geometry

WARNING: Extension  already installed. Re-installing...
Downloading precompiled GRASS Addons ...
Updating addons metadata file...
Installation of  successfully finished
(Mon Oct 08 16:55:04 2018) Command finished (4 sec)

(Mon Oct 08 16:55:53 2018)

r.object.geometry SegmW24IDM4DV4 output=test.csv

Calculating statistics
Writing output
(Mon Oct 08 16:56:14 2018) Command finished (21 sec)

g.region -p

projection: 1 (UTM)
zone:   21
datum:  wgs84
ellipsoid:  wgs84
north:  634826.41313284
south:  611477.61329757
west:   775494.11663193
east:   793630.22784822
nsres:  0.5642
ewres:  0.5307
rows:   46697
cols:   36272
cells:  1693793584

r.info SegmW24IDM4DV4

 ++
 | Map:  SegmW24IDM4DV4 Date: Fri Oct 05 23:46:04 2018
  |
 | Mapset:   LUP1   Login of Creator: haarlooj
  |
 | Location: Cottica_LUP
  |
 | DataBase: Z:\GRASS_GIS
   |
 | Title:
   |
 | Timestamp: none
  |
 ||
 |
  |
 |   Type of Map:  raster   Number of Categories: 0
   |
 |   Data Type:CELL
   |
 |   Rows: 46697
  |
 |   Columns:  36272
  |
 |   Total Cells:  ju
   |
 |Projection: UTM (zone 21)
   |
 |N: 634826.41313284S: 611477.61329757   Res: 0.5642
  |
 |E: 793630.22784822W: 775494.11663193   Res: 0.5307
  |
 |   Range of data:min = 1  max = 12901
   |
 |
  |
 |   Data Description:
  |
 |generated by i.segment
  |
 |
  |
 |   Comments:
  |
 |i.segment --overwrite group="DV4@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1"
out\   |
 |put="SegmW24IDM4DV4" threshold=0.25 radius=1.5
method="region_growin\   |
 |g" similarity="euclidean" minsize=5000 memory=1
seeds="SegW24IDM\   |
 |4DV4@LUP1" goodness="SegmW24IDM4DV4_goodn"

On Mon, Oct 8, 2018 at 4:27 PM Moritz Lennert 
wrote:

>
>
> Am 8. Oktober 2018 20:40:39 MESZ schrieb Jamille Haarloo <
> j.r.haar...@gmail.com>:
> >Sorry about that Moritz. Possibly I made that mistake, but I tried
> >several
> >times. I don't think I reproduced the same mistake in all tries.
> >These are the i.segment.stats results with Grass 7.6 (64 bit;
> >r73480-35). I
> >am reading up on this error now.
> >
> >i.segment.stats -n map=SegmW24IDM4DV4@LUP1
> >rasters=W2@LUP1,W4@LUP1,DV2@LUP1
> >,DV4@LUP1,IDM2@LUP1,IDM4@LUP1
>
> >raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
> >area_measures=compact_circle csvfile=X:\Projecten\Land-use Planning
> >Marowijne\GIS en RS\Werkfolder\GRASS &
> >R\grass_cmd_output-i.segment.statsSegmWV24IDM4DV4_5okt2018.txt
> >vectormap=VSegmWV24IDM4DV4 processes=4
> >Calculating geometry statistics...
> >Traceback (most recent call last):
> >  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> >pts/i.segment.stats.py", line 370, in 
> >main()
> >  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> >pts/i.segment.stats.py", line 219, in main
> >quiet=True)
> >  File "C:\Program Files\GRASS GIS
> >7.6.svn\etc\python\grass\script\core.py", line 423, in
> >run_command
> >return handle_errors(returncode, returncode, args,
> >kwargs)
> >  File "C:\Program Files\GRASS GIS
> >7.6.svn\etc\python\grass\script\core.py", line 334, in
> >handle_errors
> >returncode=returncode)
> >grass.exceptions.CalledModuleError: Module run None
> >['r.object.geometry', '--o', '--q', 'output=Z:\\GRASS_GIS\\C
> >ottica_LUP\\LUP1\\.tmp/unknown\\10956.0',
> >'input=SegmW24IDM4DV4@LUP1'] ended with error
>
>
> Could you directly run r.object.geometry:
>
> r.object.geometry SegmW24IDM4DV4 output=test.csv
>
> and tell us what you get ?
>
> And what is your computational region (g.region -p)  and the output of
> r.info SegmW24IDM4DV4 ?
>
> Moritz
>
> >Process ended with non-zero return code -1073741515. See
> >errors in the (error) output.
> >
> >On Mon, Oct 8, 2018 at 10:06 AM Moritz Lennert
> >
> >wrote:
> >
> >> On 04/10/18 17:06, Jamille Haarloo wrote:
> >> > i.segment.stats errors:
> >>
> >> Please, whenever you report errors, also report the command line
> >used.
> >>
> >> > ERROR: Error while executing: 'CREATE TABLE segmstat_tmp_vect_7968
> >(cat
> >> > int, area double precision, compact_circle double precisi

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-08 Thread Jamille Haarloo
Sorry about that Moritz. Possibly I made that mistake, but I tried several
times. I don't think I reproduced the same mistake in all tries.
These are the i.segment.stats results with Grass 7.6 (64 bit; r73480-35). I
am reading up on this error now.

i.segment.stats -n map=SegmW24IDM4DV4@LUP1 rasters=W2@LUP1,W4@LUP1,DV2@LUP1
,DV4@LUP1,IDM2@LUP1,IDM4@LUP1
raster_statistics=mean,stddev,variance,coeff_var,first_quart,median,third_quart,perc_90
area_measures=compact_circle csvfile=X:\Projecten\Land-use Planning
Marowijne\GIS en RS\Werkfolder\GRASS &
R\grass_cmd_output-i.segment.statsSegmWV24IDM4DV4_5okt2018.txt
vectormap=VSegmWV24IDM4DV4 processes=4
Calculating geometry statistics...
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 370, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 219, in main
quiet=True)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 423, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.6.svn\etc\python\grass\script\core.py", line 334, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['r.object.geometry', '--o', '--q', 'output=Z:\\GRASS_GIS\\C
ottica_LUP\\LUP1\\.tmp/unknown\\10956.0',
'input=SegmW24IDM4DV4@LUP1'] ended with error
Process ended with non-zero return code -1073741515. See
errors in the (error) output.

On Mon, Oct 8, 2018 at 10:06 AM Moritz Lennert 
wrote:

> On 04/10/18 17:06, Jamille Haarloo wrote:
> > i.segment.stats errors:
>
> Please, whenever you report errors, also report the command line used.
>
> > ERROR: Error while executing: 'CREATE TABLE segmstat_tmp_vect_7968 (cat
> > int, area double precision, compact_circle double precision, DV2_mean
> > double precision, DV2_stddev double precision, DV2_variance double
> > precision, DV2_coeff_var double precision, DV2_first_quart double
> > precision, DV2_median double precision, DV2_third_quart double
> > precision, DV2_perc_90 double precision, DV4_mean double precision,
> > DV4_stddev double precision, DV4_variance double precision,
> > DV4_coeff_var double precision, DV4_first_quart double precision,
> > DV4_median double precision, DV4_third_quart double precision,
> > DV4_perc_90 double precision, IDM2_mean double precision, IDM2_stddev
> > double precision, IDM2_variance double precision, IDM2_coeff_var double
> > precision, IDM2_first_quart double precision, IDM2_median double
> > precision, IDM2_third_quart double precision, IDM2_perc_90 double
> > precision, IDM4_mean double precision, IDM4_stddev double precision,
> > IDM4_variance double precision, IDM4_coeff_var double precision,
> > IDM4_first_quart double precision, IDM4_median double precision,
> > IDM4_third_quart double precision, IDM4_perc_90 double precision,
> > W2_mean double precision, W2_stddev double precision, W2_variance double
> > precision, W2_coeff_var double precision, W2_first_quart double
> > precision, W2_median double precision, W2_third_quart double precision,
> > W2_perc_90 double precision, DV4_mean double precision, DV4_stddev
> > double precision, DV4_variance double precision, DV4_coeff_var double
> > precision, DV4_first_quart double precision, DV4_median double
> > precision, DV4_third_quart double precision, DV4_perc_90 double
> > precision, neighbors_count double precision, area_nbrmean double
> > precision, area_nbrstddev double precision, compact_circle_nbrmean
> > double precision, compact_circle_nbrstddev double precision,
> > DV2_mean_nbrmean double precision, DV2_mean_nbrstddev double precision,
> > DV2_stddev_nbrmean double precision, DV2_stddev_nbrstddev double
> > precision, DV2_variance_nbrmean double precision,
> > DV2_variance_nbrstddeGRASS_INFO_ERROR(7020,1):
>
> The DV2 and DV4 maps seem to be there twice and so there are duplicate
> column names, leading to a failure in the CREATE TABLE call.
>
> In the call to i.segment.stats, did you maybe add these map names twice
> to the 'rasters' parameter by accident ?
>
> Moritz
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.segment and i.segment.stats errors

2018-10-08 Thread Jamille Haarloo
Thank you Markus,

I just got the i.segment results with Grass 7.6 (64 bit; r73480-35).

This is the output:
i.segment --overwrite group=DV4@LUP1,IDM4@LUP1,W2@LUP1,W4@LUP1
output=SegmW24IDM4DV4 threshold=0.25 minsize=5000 memory=1
seeds=SegW24IDM4DV4@LUP1 goodness=SegmW24IDM4DV4_goodn
Maximum number of iterations set to 50
Loading input bands...
Loading seeds from raster map ...
Processing pass 1...
Processing pass 2...
Processing pass 3...
Processing pass 4...
Processing pass 5...
Processing pass 6...
Processing pass 7...
Processing pass 8...
Processing pass 9...
Segmentation converged after 9 iterations
Assigning region IDs to remaining single-cell regions...
Merging segments smaller than 5000 cells...
Writing out segment IDs...
Writing out goodness of fit
ERROR: Region of size 635805 should be in search tree

On Thu, Oct 4, 2018 at 4:07 PM Markus Metz 
wrote:

> Can you please try with GRASS 7.6 64 bit [0] and report if the error still
> persists or not?
>
> Thanks,
>
> Markus M
>
> [0] https://wingrass.fsv.cvut.cz/grass76/x86_64/
>
> On Thu, Oct 4, 2018 at 5:07 PM Jamille Haarloo 
> wrote:
> >
> > Dear Grass community,
> >
> > I have been experimenting with i.segment, i.segment.uspo and
> i.segment.stats on relatively small areas of a worldview-2 image.
> > After some success I tried i.segment and i.segment.stats on the entire
> area of 19875 ha, but I kept getting the same errors with i.segment.stats.
> I started using a mask to eliminate most of the matrix, to see if that
> helped. It did not, so I started the process again in i.segment but with
> the previous segmentation output as seed to reduce processing. This time I
> also got an error with i.segment in 2 attempts with different parameters. I
> looked for documentation, but I couldn't find any solutions and I rather
> not mess with the scripts. I do get a raster-output which looks ok, but
> i.segment.stats fails to create an attribute table for further analyses. My
> questions are: Is the area too big (too much pixels)? Are there too many
> segments? The count of the last output is 9054 segments. Or should I start
> the process again form the beginning without the seed assuming the Mask is
> not the problem? The processing might take several weeks though.
> >
> >  i.segment error:
> > ERROR: Region of size 501508 should be in search tree
> >
> > i.segment.stats errors:
> > ERROR: Error while executing: 'CREATE TABLE segmstat_tmp_vect_7968 (cat
> int, area double precision, compact_circle double precision, DV2_mean
> double precision, DV2_stddev double precision, DV2_variance double
> precision, DV2_coeff_var double precision, DV2_first_quart double
> precision, DV2_median double precision, DV2_third_quart double precision,
> DV2_perc_90 double precision, DV4_mean double precision, DV4_stddev double
> precision, DV4_variance double precision, DV4_coeff_var double precision,
> DV4_first_quart double precision, DV4_median double precision,
> DV4_third_quart double precision, DV4_perc_90 double precision, IDM2_mean
> double precision, IDM2_stddev double precision, IDM2_variance double
> precision, IDM2_coeff_var double precision, IDM2_first_quart double
> precision, IDM2_median double precision, IDM2_third_quart double precision,
> IDM2_perc_90 double precision, IDM4_mean double precision, IDM4_stddev
> double precision, IDM4_variance double precision, IDM4_coeff_var double
> precision, IDM4_first_quart double precision, IDM4_median double precision,
> IDM4_third_quart double precision, IDM4_perc_90 double precision, W2_mean
> double precision, W2_stddev double precision, W2_variance double precision,
> W2_coeff_var double precision, W2_first_quart double precision, W2_median
> double precision, W2_third_quart double precision, W2_perc_90 double
> precision, DV4_mean double precision, DV4_stddev double precision,
> DV4_variance double precision, DV4_coeff_var double precision,
> DV4_first_quart double precision, DV4_median double precision,
> DV4_third_quart double precision, DV4_perc_90 double precision,
> neighbors_count double precision, area_nbrmean double precision,
> area_nbrstddev double precision, compact_circle_nbrmean double precision,
> compact_circle_nbrstddev double precision, DV2_mean_nbrmean double
> precision, DV2_mean_nbrstddev double precision, DV2_stddev_nbrmean double
> precision, DV2_stddev_nbrstddev double precision, DV2_variance_nbrmean
> double precision, DV2_variance_nbrstddeGRASS_INFO_ERROR(7020,1):
> > Traceback (most recent call last):
> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.stats.py", line 370, in 
> > main()
> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
> > pts/i.segment.s

[GRASS-user] i.segment and i.segment.stats errors

2018-10-04 Thread Jamille Haarloo
Dear Grass community,

I have been experimenting with i.segment, i.segment.uspo and
i.segment.stats on relatively small areas of a worldview-2 image.
After some success I tried i.segment and i.segment.stats on the entire area
of 19875 ha, but I kept getting the same errors with i.segment.stats. I
started using a mask to eliminate most of the matrix, to see if that
helped. It did not, so I started the process again in i.segment but with
the previous segmentation output as seed to reduce processing. This time I
also got an error with i.segment in 2 attempts with different parameters. I
looked for documentation, but I couldn't find any solutions and I rather
not mess with the scripts. I do get a raster-output which looks ok, but
i.segment.stats fails to create an attribute table for further analyses. My
questions are: Is the area too big (too much pixels)? Are there too many
segments? The count of the last output is 9054 segments. Or should I start
the process again form the beginning without the seed assuming the Mask is
not the problem? The processing might take several weeks though.

 i.segment error:
ERROR: Region of size 501508 should be in search tree

i.segment.stats errors:
ERROR: Error while executing: 'CREATE TABLE segmstat_tmp_vect_7968 (cat
int, area double precision, compact_circle double precision, DV2_mean
double precision, DV2_stddev double precision, DV2_variance double
precision, DV2_coeff_var double precision, DV2_first_quart double
precision, DV2_median double precision, DV2_third_quart double precision,
DV2_perc_90 double precision, DV4_mean double precision, DV4_stddev double
precision, DV4_variance double precision, DV4_coeff_var double precision,
DV4_first_quart double precision, DV4_median double precision,
DV4_third_quart double precision, DV4_perc_90 double precision, IDM2_mean
double precision, IDM2_stddev double precision, IDM2_variance double
precision, IDM2_coeff_var double precision, IDM2_first_quart double
precision, IDM2_median double precision, IDM2_third_quart double precision,
IDM2_perc_90 double precision, IDM4_mean double precision, IDM4_stddev
double precision, IDM4_variance double precision, IDM4_coeff_var double
precision, IDM4_first_quart double precision, IDM4_median double precision,
IDM4_third_quart double precision, IDM4_perc_90 double precision, W2_mean
double precision, W2_stddev double precision, W2_variance double precision,
W2_coeff_var double precision, W2_first_quart double precision, W2_median
double precision, W2_third_quart double precision, W2_perc_90 double
precision, DV4_mean double precision, DV4_stddev double precision,
DV4_variance double precision, DV4_coeff_var double precision,
DV4_first_quart double precision, DV4_median double precision,
DV4_third_quart double precision, DV4_perc_90 double precision,
neighbors_count double precision, area_nbrmean double precision,
area_nbrstddev double precision, compact_circle_nbrmean double precision,
compact_circle_nbrstddev double precision, DV2_mean_nbrmean double
precision, DV2_mean_nbrstddev double precision, DV2_stddev_nbrmean double
precision, DV2_stddev_nbrstddev double precision, DV2_variance_nbrmean
double precision, DV2_variance_nbrstddeGRASS_INFO_ERROR(7020,1):
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 370, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/i.segment.stats.py", line 357, in main
gscript.run_command('db.execute', input=insert_sql,
quiet=True)
  File "C:\Program Files\GRASS GIS
7.4.0\etc\python\grass\script\core.py", line 421, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
  File "C:\Program Files\GRASS GIS
7.4.0\etc\python\grass\script\core.py", line 332, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['db.execute', '--q', 'input=Z:\\GRASS_GIS\\Cottica_LUP\\LUP
1\\.tmp/unknown\\7968.1'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.class.mlR Error

2018-06-19 Thread Jamille Haarloo
Hi Moritz,

Thanx for the advice! Will check it out. From the publications I read, I
inferred it was better to use an alternative method (data mining/
object-based) on high resolution imagery than pixel-based. I also read that
texture metrics (e.g. standard deviation of spectral bands) may capture the
unique “patterns” of wetlands and other ecosystems (given the appropriate
spatial scale). Will continue testing and checking for improvements.

I was running directy from GRASS GIS, but recently created and used a new
training map with the lower case column name. My apologies for the
inconsistency, but good to know that the previous training map wasn't the
issue.

Best,
Jamille

On Tue, Jun 19, 2018 at 6:58 AM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> P.S. I'm not sure that for the landscape you are working on (mainly forest
> areas) OBIA is the best approach. You might want to also try a pixel-based
> approach with i.smap:
>
> #create raster training areas
> v.to.rast Training_Ben5 out=training use=attr attrcol=Ecosystem
> #create a subgroup with all four bands
> i.group WV_Benatimofo subg=sub in=WV_Benatimofo.1@haarlooj_Be
> n_Test,WV_Benatimofo.2@haarlooj_Ben_Test,WV_Benatimofo.3@
> haarlooj_Ben_Test,WV_Benatimofo.4@haarlooj_Ben_Test
> #create signature file
> i.gensigset training group=WV_Benatimofo sub=sub
> #classify
> i.smap group=WV_Benatimofo sub=sub sig=sig out=smap_classified
> goodness=smap_goodness
>
> Moritz
>
>
> On 19/06/18 11:33, Moritz Lennert wrote:
>
>> Hi Jamille,
>>
>> Testing with the data you sent me offlist (which BTW was a mapset, not a
>> location. A location contains at least one mapset named PERMANENT which
>> contains the projection info - I just assumed that you are working in
>> UTM Zone 21N, created my own location and copied your mapset into that
>> location.) and with the following command:
>>
>> v.class.mlR -i --overwrite
>> segments_map=Segments_vector_Stats_Ben_test@haarlooj_Ben_Test
>> training_map=Training_Ben5@haarlooj_Ben_Test
>> raster_segments_map=best5_myregion1_at_haarlooj_Ben_Test_
>> rank1@haarlooj_Ben_Test
>> train_class_column=Ecosystem output_class_column=vote
>> output_prob_column=prob classifiers=svmRadial,rf,C5.0 folds=5
>> partitions=10 tunelength=10 weighting_metric=accuracy
>> r_script_file=R-script processes=3
>>
>> the module runs perfectly fine for me here on GNU/Linux. Note the fact
>> that the train_class_column=Ecosystem, not ecosystem. Case matters here.
>>
>> Could you try with the training class column in the right case ?
>>
>> Moritz
>>
>> On 18/06/18 21:51, Jamille Haarloo wrote:
>>
>>> Hello Moritz,
>>>
>>> It looks like I got some results, but I suspect there are still some
>>> issues due to the warning messages.
>>>
>>> I either kept getting that a file couldn't be found or that it had
>>> trouble running the R-script.
>>> My actions:
>>>
>>>   1. I found that it was looking in "C:\Program Files\QGIS
>>>  2.16.0\apps\Python27\Lib" for certain scripts but I also had another
>>>  location of the Python27 library "C:\Program Files\GRASS GIS
>>>  7.4.0\Python27\Lib". So I tried adding the second location via the
>>>  black terminal because I figured it needed the GRASS
>>>  versions/formats (with my lack of experience I am not sure if I
>>>  succeeded).
>>>   2. It was still failing, and I suspected this had to do with the qbwwv
>>>  voting method (see output). So I unchecked that option and got
>>>  results. I'am also sending a screenshot of the attribute table with
>>>  results.
>>>
>>> Do you have any suggestions for improvement?
>>> Soon I will test with a much bigger area for a land-use planning project.
>>>
>>>
>>> /The last 2 command outputs:/
>>>
>>> Running R now. Following output is R output.
>>> During startup - Warning messages:
>>> 1: Setting LC_CTYPE=en_US.cp1252 failed
>>> 2: Setting LC_COLLATE=en_US.cp1252 failed
>>> 3: Setting LC_TIME=en_US.cp1252 failed
>>> 4: Setting LC_MONETARY=en_US.cp1252 failed
>>> Loading required package: caret
>>> Loading required package: lattice
>>> Loading required package: ggplot2
>>> Loading required package: foreach
>>> Loading required package: iterators
>>> Loading required package: parallel
>>> During startup - Warning messages:
>>> 1: Setting LC_CTYPE=en_US.cp1252 failed
>>> 2: Setting LC_COLLATE=en_US.cp1252 failed

Re: [GRASS-user] v.class.mlR Error

2018-06-08 Thread Jamille Haarloo
Hello Moritz,

This time I asked a vector to be created with the stats and used this to
extract training polygons in QGIS and imported the training map in GRASS.
I had to do some interventions regarding the column names to make sure they
are the same except for the class.
I still get an error, and the only thing I could trace is the fact that
values are missing in some rows  for both vectors. I am not sure if I
should correct this/ retry it all.

This is the command output:

(Fri Jun 08 15:48:28 2018)

v.class.mlR -i --overwrite
segments_map=Segments_vector_Stats_Ben_test@haarlooj_Ben_Test
training_map=Training_Ben5@haarlooj_Ben_Test
raster_segments_map=best5_myregion1_at_haarlooj_Ben_Test_rank1@haarlooj_Ben_Test
train_class_column=Ecosystem output_class_column=vote
output_prob_column=prob classifiers=svmRadial,rf,C5.0 folds=5 partitions=10
tunelength=10 weighting_modes=smv,qbwwv weighting_metric=accuracy
classification_results=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-results
accuracy_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-accuracy
model_details=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-module-runs
bw_plot_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-performance
r_script_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_R_script
processes=3
Running R now. Following output is R output.
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
  There were missing values in resampled performance measures.
Error in `$<-.data.frame`(`*tmp*`, vote_qbwwv, value = numeric(0)) :
  replacement has 0 rows, data has 1965
Calls: $<- -> $<-.data.frame
Execution halted
ERROR: There was an error in the execution of the R script.
Please check the R output.
(Fri Jun 08 15:49:32 2018) Command finished (1 min 4 sec)



Best,
Jamille




On Thu, Jun 7, 2018 at 11:09 AM, Jamille Haarloo 
wrote:

> Hello Moritz,
>
> No worries. Thankful these modules are made available for newbies in RS
> like me and also happy these interactions are possible for learning.
> Hope to get back soon after some adjustments.
>
> Best,
> Jamille
>
> On Thu, Jun 7, 2018 at 10:44 AM, Moritz Lennert <
> mlenn...@club.worldonline.be> wrote:
>
>> Thanks
>>
>> On 07/06/18 15:17, Jamille Haarloo wrote:
>>
>>> The first 20+ lines of Stats_Training_Ben_test:
>>>
>>> cat,area,perimeter,compact_circle,compact_square,fd,WV_Benat
>>> imofo_1_min,WV_Benatimofo_1_max,WV_Benatimofo_1_range,WV_Ben
>>> atimofo_1_mean,WV_Benatimofo_1_stddev,WV_Benatimofo_1_varia
>>> nce,WV_Benatimofo_1_coeff_var,WV_Benatimofo_1_sum,WV_
>>> Benatimofo_1_first_quart,WV_Benatimofo_1_median,WV_Benatim
>>> ofo_1_third_quart,WV_Benatimofo_2_min,WV_Benatimofo_2_max,
>>> WV_Benatimofo_2_range,WV_Benatimofo_2_mean,WV_Benatimofo_2_
>>> stddev,WV_Benatimofo_2_variance,WV_Benatimofo_2_coeff_var,
>>> WV_Benatimofo_2_sum,WV_Benatimofo_2_first_quart,WV_
>>> Benatimofo_2_median,WV_Benatimofo_2_third_quart,WV_Benatimof
>>> o_3_min,WV_Benatimofo_3_max,WV_Benatimofo_3_range,WV_Benat
>>> imofo_3_mean,WV_Benatimofo_3_stddev,WV_Benatimofo_3_varianc
>>> e,WV_Benatimofo_3_coeff_var,WV_Benatimofo_3_sum,WV_
>>> Benatimofo_3_first_quart,WV_Benatimofo_3_median,WV_Benatim
>>> ofo_3_third_quart,WV_Benatimofo_4_min,WV_Benatimofo_4_max,
>>> WV_Benatimofo_4_range,WV_Benatimofo_4_mean,WV_Benatimofo_4_
>>> stddev,WV_Benatimofo_4_variance,WV_Benatimofo_4_coeff_var,
>>> WV_Benatimofo_4_sum,WV_Benatimofo_4_first_quart,WV_
>>> Benatimofo_4_median,WV_Benatimofo_4_third_quart
>>> 1144,3832.00,1256.00,5.723635,0.19

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
Hello Moritz,

No worries. Thankful these modules are made available for newbies in RS
like me and also happy these interactions are possible for learning.
Hope to get back soon after some adjustments.

Best,
Jamille

On Thu, Jun 7, 2018 at 10:44 AM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> Thanks
>
> On 07/06/18 15:17, Jamille Haarloo wrote:
>
>> The first 20+ lines of Stats_Training_Ben_test:
>>
>> cat,area,perimeter,compact_circle,compact_square,fd,WV_Benat
>> imofo_1_min,WV_Benatimofo_1_max,WV_Benatimofo_1_range,WV_B
>> enatimofo_1_mean,WV_Benatimofo_1_stddev,WV_Benatimofo_1_
>> variance,WV_Benatimofo_1_coeff_var,WV_Benatimofo_1_sum,
>> WV_Benatimofo_1_first_quart,WV_Benatimofo_1_median,WV_Bena
>> timofo_1_third_quart,WV_Benatimofo_2_min,WV_Benatimofo_2_
>> max,WV_Benatimofo_2_range,WV_Benatimofo_2_mean,WV_Benatimofo
>> _2_stddev,WV_Benatimofo_2_variance,WV_Benatimofo_2_
>> coeff_var,WV_Benatimofo_2_sum,WV_Benatimofo_2_first_quart,
>> WV_Benatimofo_2_median,WV_Benatimofo_2_third_quart,WV_Benati
>> mofo_3_min,WV_Benatimofo_3_max,WV_Benatimofo_3_range,WV_B
>> enatimofo_3_mean,WV_Benatimofo_3_stddev,WV_Benatimofo_3_
>> variance,WV_Benatimofo_3_coeff_var,WV_Benatimofo_3_sum,
>> WV_Benatimofo_3_first_quart,WV_Benatimofo_3_median,WV_Bena
>> timofo_3_third_quart,WV_Benatimofo_4_min,WV_Benatimofo_4_
>> max,WV_Benatimofo_4_range,WV_Benatimofo_4_mean,WV_Benatimofo
>> _4_stddev,WV_Benatimofo_4_variance,WV_Benatimofo_4_
>> coeff_var,WV_Benatimofo_4_sum,WV_Benatimofo_4_first_quart,
>> WV_Benatimofo_4_median,WV_Benatimofo_4_third_quart
>> 1144,3832.00,1256.00,5.723635,0.197144,1.729624,13,7
>> 6,63,46.4097077244259,9.98454911351384,99.69122100017,21.
>> 5139237092391,177842,40,47,53,40,138,98,90.2687891440501,15.
>> 2500825418009,232.565017531741,16.8940812061464,345910,81,
>> 92,100,15,61,46,40.8582985386221,7.82663897784868,61.2562776
>> 895802,19.1555675536767,156569,36,42,47,28,124,96,68.
>> 4253653444676,13.5774536655369,184.347248039801,19.
>> 8427200164517,262206,59,68,77
>> 1145,12092.00,2282.00,5.854120,0.192750,1.645226,13,
>> 94,81,51.386288455177,10.5294376761475,110.869057775874,20.
>> 4907534532914,621363,45,52,59,21,220,199,114.230731061859,
>> 23.3590328249442,545.644414516822,20.4489917973953,1381278,
>> 101,114,128,7,76,69,46.4219318557724,8.42747122371732
>> ,71.0222712265835,18.1540726264915,561334,42,48,52,17,198,
>> 181,97.2732385047966,22.492313569247,505.904169697333,
>> 23.1228176577445,1176228,84,97,110
>>
>> [...]
>
> -
>> All the lines of the output of v.db.select Training_Ben2@haarlooj_Ben_Tes
>> t:
>>
>> cat|id|Type|code
>> 1|4|B29|18
>> 2|5|B31|19
>> 3|3|B28|17
>>
>
>
> Again a lack of clear documentation on my side: both the training and the
> segment info should contain the same attributes, with only additional one
> column ('code' in your case) present in the training data.
>
> It should be possible to do this differently, i.e. provide the module with
> the features of all segments, and only the id/cat of each training segment
> with the relevant class and have the module merge the two, but this is not
> implemented, yet.
>
> I also just notice that you have the word 'Training' in both names.
>
> The segment_file/segment_map contains the info (cat + all feature
> variables) of all segments you wish to classify, either in the form of a
> csv file or in the form of a vector map with the info in the attribute
> table.
>
> The training_file/training_map contains the info (cat + all feature
> variables + class) of the training data. Often this is an extract of the
> former, but not necessarily.
>
> All columns in the training file have to be present in the segment file,
> except for the class column (your 'code').
>
> Sorry for the lack of docs. This module has mostly been used internally
> here and so we are not always aware of the unclear and missing parts.
> Having your feedback has been very useful !
>
> Moritz
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
.4806457530728,6.90095173587916,47.6231348609336,15.8713184138749,474026,39,44,48,18,109,91,47.4942212438085,10.0630152492691,101.264275907023,21.1878729363964,517782,40,47,54
619,2113.00,758.00,4.651730,0.242572,1.732184,27,83,56,53.1590156176053,8.07731718382203,65.2430528880666,15.1946327259434,112325,48,54,59,79,189,110,132.672976810222,15.2181957461467,231.593481768037,11.4704562391142,280338,122,132,143,28,68,40,47.8854708944628,5.4820743876128,30.0531395913203,11.4483042250853,101182,44,48,51,60,175,115,110.848083293895,17.1347521862255,293.59973248336,15.4578696149356,234222,98,109,122
910,59641.00,6614.00,7.639885,0.147696,1.600012,9,108,99,48.6661524789993,12.5089192115682,156.473059841541,25.7035302245563,2902498,41,49,57,17,241,224,99.7778038597609,26.8069453935943,718.612321335148,26.8666420352084,5950848,83,100,116,5,78,73,40.3623514025586,9.26259400434508,85.7956476893295,22.9485985887282,2407251,35,41,47,16,236,220,85.7788601800775,24.904567736095,620.237494121746,29.033456126384,5115937,69,85,101
913,38779.00,5014.00,7.182590,0.157099,1.612774,4,100,96,47.3721601897934,15.8379182683419,250.839655074677,33.4329661237492,1837045,37,47,58,12,219,207,78.8028572165347,24.3241643077939,591.664969272555,30.8671096035971,3055896,63,78,94,6,76,70,39.7297248510792,11.3190866110866,128.12172170928,28.4902214991784,1540679,33,41,48,11,230,219,61.5005544237861,23.1630381172775,536.526334822452,37.663137079491,2384930,46,58,73
298,2601.00,902.00,4.989206,0.226164,1.730650,6,84,78,32.5371011149558,13.0257289789651,169.669615433451,40.0334649757036,84629,22,31,42,9,159,150,61.1872356785852,24.6618485289733,608.206772866024,40.3055445395856,159148,42,61,77,4,79,75,27.6163014225298,12.0369971261662,144.889299815334,43.5865648408164,71830,18,27,36,5,125,120,50.3583237216455,20.7068482607764,428.77356489482,41.119018129422,130982,35,49,65
299,47514.00,3446.00,4.459637,0.253020,1.512701,1,255,254,52.1407585132803,30.3886170013007,923.46804325174,58.281885165826,2477416,35,48,62,3,255,252,78.0022309214126,33.0148910584555,1089.98303160168,42.3255728310104,3706198,58,78,99,2,254,252,46.8144336406112,26.4712438563617,700.726751302969,56.5450477508247,2224341,31,43,56,1,197,196,47.5048827713937,27.8205934975027,773.98542255329,58.5636504596441,2257147,27,43,65
296,5446.00,1628.00,6.223155,0.181319,1.719265,8,89,81,41.2229159015791,14.6340309655876,214.154862301778,35.4997472777685,224500,30,41,52,12,218,206,75.7214469335292,24.1230337146907,581.920755600103,31.8575974068043,412379,60,78,93,6,70,64,32.6788468600808,11.2187485969014,125.860320080478,34.3303074460862,177969,25,33,41,11,191,180,64.2701065001836,22.073274933182,487.229466275841,34.3445438870075,350015,49,64,79
297,3480.00,918.00,4.389834,0.257044,1.673176,13,90,77,55.2899425287356,10.8530207669023,117.788059766812,19.6292856720943,192409,49,56,62,33,240,207,134.985344827586,22.9407172809364,526.276509363853,16.9949688317928,469749,123,137,150,18,72,54,47.6103448275862,7.56993500454582,57.3039159730481,15.8997693294582,165684,43,48,53,29,195,166,123.337068965517,23.7698714092301,565.006786811335,19.2722849736892,429213,110,123,139
294,11846.00,2672.00,6.925413,0.162933,1.682473,7,111,104,50.8781867296978,11.9661829465891,143.18953431124,23.5192795100231,602703,43,51,59,17,191,174,106.163683943947,23.038014189,530.75026311267,21.7004694275517,1257615,93,106,121,7,89,82,43.5071754178626,9.52503162336439,90.7262274260917,21.8930131222762,515386,38,44,50,19,204,185,94.9231808205301,24.5256846876803,601.509209399517,25.837402914311,1124460

-
All the lines of the output of v.db.select Training_Ben2@haarlooj_Ben_Test:

cat|id|Type|code
1|4|B29|18
2|5|B31|19
3|3|B28|17
4|2|B27|16
5|1|A7|15
6|22|wolk|1
7|23|wolk|1
8|20|straat|2
9|6|bare1|4
10|8|dorp|5
11|19|rivier|3
12|24|zwamp|9
13|9|interesting|7
14|7|bare2|4
15|12|maripa2|14
16|21|straat|2
17|25|zwamp2|10
18|15|openzwamp|8
19|13|mataki|12
20|14|Mauricius|11
21|10|maripa|13
22|16|privatehousing|6
23|17|privatehousing|6
24|18|privatehousing|6


>> At first I was using "Type" as attribute collumn for classification, but
just in case I added the column "code" with only numbers to use
as attribute column.


Reinstalling it and giving another go.

Best,
Jamille


On Thu, Jun 7, 2018 at 9:39 AM, Moritz Lennert  wrote:

> On 07/06/18 13:45, Jamille Haarloo wrote:
>
>> I see. That was one of the big problems then. I knew it used R-resources
>> but wasn't sure the software itself was required. Must have overlooked it
>> in the documentation and other user- topics as I was reading about the
>> module.
>>
>
> You are right that it is never explicitely stated that it is the user's
> responsibility to install R. I just committed a patch to the man page which
> explains this in the Dependencies section.
>
>
>> Now I have R-3.5, but still get an error:
>>
>&

Re: [GRASS-user] v.class.mlR Error

2018-06-07 Thread Jamille Haarloo
I see. That was one of the big problems then. I knew it used R-resources
but wasn't sure the software itself was required. Must have overlooked it
in the documentation and other user- topics as I was reading about the
module.

Now I have R-3.5, but still get an error:

v.class.mlR --overwrite training_map=Training_Ben2@haarlooj_Ben_Test
segments_file=C:\Users\haarlooj\Documents\CELOS\Stats_Training_Ben_test
raster_segments_map=best_myregion1_at_haarlooj_Ben_Test_rank1@haarlooj_Ben_Test
train_class_column=code output_class_column=vote output_prob_column=prob
classifiers=svmRadial,rf,C5.0 folds=5 partitions=10 tunelength=10
weighting_modes=smv,qbwwv weighting_metric=accuracy
classification_results=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-results
accuracy_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-accuracy
model_details=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-module-runs
bw_plot_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_Classifier-performance
r_script_file=C:\Users\haarlooj\Documents\CELOS\v.class.mIRR_optional_output\Ben_test_R_script
processes=3
Running R now. Following output is R output.
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
During startup - Warning messages:
1: Setting LC_CTYPE=en_US.cp1252 failed
2: Setting LC_COLLATE=en_US.cp1252 failed
3: Setting LC_TIME=en_US.cp1252 failed
4: Setting LC_MONETARY=en_US.cp1252 failed
Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
  There were missing values in resampled performance measures.
Error in eval(predvars, data, env) : object 'id' not found
Calls: data.frame ... predict.train -> model.frame -> model.frame.default
-> eval -> eval
Execution halted
ERROR: There was an error in the execution of the R script.
Please check the R output.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 236, in cleanup
gscript.try_remove(model_output_csv)
NameError: global name 'model_output_csv' is not defined
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 236, in cleanup
gscript.try_remove(model_output_csv)
NameError: global name 'model_output_csv' is not defined

On Wed, Jun 6, 2018 at 4:05 AM, Moritz Lennert  wrote:

> On 04/06/18 15:42, Jamille Haarloo wrote:
>
>> It did not work out from another station, but I tried today from the same
>> computer.
>> I first reinstalled the module.
>> This is the command output:
>>
>> Running R now. Following output is R output.
>> Traceback (most recent call last):
>>File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
>> pts/v.class.mlR.py <http://v.class.mlR.py>", line 632, in 
>>  main()
>>File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
>> pts/v.class.mlR.py <http://v.class.mlR.py>", line 569, in main
>>  subprocess.check_call(['Rscript', r_commands],
>> stderr=subprocess.STDOUT, )
>>File "C:\Program Files\GRASS GIS
>> 7.4.0\Python27\lib\subprocess.py", line 537, in check_call
>>  retcode = call(*popenargs, **kwargs)
>>File "C:\Program Files\GRASS GIS
>> 7.4.0\Python27\lib\subprocess.py", line 524, in call
>>  return Popen(*popenargs, **kwargs).wait()
>>File "C:\Program Files\GRASS GIS
>> 7.4.0\Python27\lib\subprocess.py", line 711, in __init__
>>  errread, errwrite)
>>File "C:\Program Files\GRASS GIS
>> 7.4.0\Python27\lib\subprocess.py", line 948, in
>> _execute_child
>>  startupinfo)
>>

Re: [GRASS-user] v.class.mlR Error

2018-06-04 Thread Jamille Haarloo
It did not work out from another station, but I tried today from the same
computer.
I first reinstalled the module.
This is the command output:

Running R now. Following output is R output.
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 632, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 569, in main
subprocess.check_call(['Rscript', r_commands],
stderr=subprocess.STDOUT, )
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 537, in check_call
retcode = call(*popenargs, **kwargs)
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 524, in call
return Popen(*popenargs, **kwargs).wait()
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 711, in __init__
errread, errwrite)
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 948, in
_execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file
specified
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 236, in cleanup
gscript.try_remove(model_output_csv)
NameError: global name 'model_output_csv' is not defined
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 236, in cleanup
gscript.try_remove(model_output_csv)
NameError: global name 'model_output_csv' is not defined

On Sat, Jun 2, 2018 at 11:13 AM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> Le Fri, 1 Jun 2018 12:15:03 -0700 (MST),
> Helmut Kudrnovsky  a écrit :
>
> > >I committed a patch in r72758 which now correctly applies the
> > >replace() call to all tempfiles created. Please test.
> >
> > locally patched the addons script with this  v.patch
> >   , then the
> > script also works with exporting result files incl boxplot png.
>
> Committed as r72759.
>
> Thanks for finding those and all the other windows specific issues !
>
> Moritz
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.class.mlR Error

2018-06-01 Thread Jamille Haarloo
Hi Moritz and Helmut,

Great proactive energy. Highly appreciated!

For clarity, tomorrow I should install the v.class.mlR again and test it?
Should I also install the needed packages first in R as stated in one of
the messages?
I will not have access to the same computer this weekend, but I can try to
test on another station.

Best,
Jamille



On Fri, Jun 1, 2018 at 2:02 PM, Helmut Kudrnovsky  wrote:

> >I committed a patch in r72758 which now correctly applies the replace()
> >call to all tempfiles created. Please test.
>
> tested now with export to files:
>
> ---
> v.class.mlR -i segments_map=lsat7_segs_stats@user1
> training_map=training@user1 train_class_column=class
> output_class_column=vote1 output_prob_column=prob1 folds=5 partitions=10
> tunelength=10 weighting_metric=accuracy
> classification_results=D:\temp\vclassr\f1.txt
> accuracy_file=D:\temp\vclassr\f2.txt model_details=D:\temp\vclassr\f3.txt
> bw_plot_file=D:\temp\vclassr\bw.png
> r_script_file=D:\temp\vclassr\myRscript.R processes=4
> Running R now. Following output is R output.
> Loading required package: caret
> Loading required package: lattice
> Loading required package: ggplot2
> Loading required package: foreach
> Loading required package: iterators
> Loading required package: parallel
> Warning message:
> In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
>   There were missing values in resampled performance measures.
> Error in file(file, ifelse(append, "a", "w")) :
>   cannot open the connection
> Calls: write.csv -> eval.parent -> eval -> eval -> write.table -> file
> In addition: Warning message:
> In file(file, ifelse(append, "a", "w")) :
>   cannot open file 'D:  emp classr 1.txt': Invalid argument
> Execution halted
> ERROR: There was an error in the execution of the R script.
> Please check the R output.
> Error in atexit._run_exitfuncs:
> Traceback (most recent call last):
>   File "C:\OSGEO4~1\apps\Python27\lib\atexit.py", line 24,
> in _run_exitfuncs
> func(*targs, **kargs)
>   File "C:\Users\hkmyr\AppData\Roaming\GRASS7\addons/scripts
> /v.class.mlR.py", line 237, in cleanup
> gscript.try_remove(model_output_csvt)
> NameError: global name 'model_output_csvt' is not defined
> Error in sys.exitfunc:
> Traceback (most recent call last):
>   File "C:\OSGEO4~1\apps\Python27\lib\atexit.py", line 24,
> in _run_exitfuncs
> func(*targs, **kargs)
>   File "C:\Users\hkmyr\AppData\Roaming\GRASS7\addons/scripts
> /v.class.mlR.py", line 237, in cleanup
> gscript.try_remove(model_output_csvt)
> NameError: global name 'model_output_csvt' is not defined
> (Fri Jun 01 18:55:30 2018) Command finished (2 min 22 sec)
> --
>
> it seems the path to the first file f1.txt can't be resolved.
>
> looking into myRscript.R
>
> 
> write.csv(resultsdf, 'D:\temp\vclassr\f1.txt', row.names=FALSE,
> quote=FALSE)
> df_means <- data.frame(method=names(models.cv),accuracy=accuracy_means,
> kappa=kappa_means)
> write.csv(df_means, 'D:\temp\vclassr\f2.txt', row.names=FALSE, quote=FALSE)
> sink('D:\temp\vclassr\f3.txt')
> 
>
> it seems also here is a / needed instead of \ within the path.
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.class.mlR Error

2018-05-29 Thread Jamille Haarloo
Dear GRASS GIS community,

I just started working with Grass to try some object-based analysis. I do
not have much experience with programming, but learning bits on the go.
The segmentation test with uspo appears to have been ok, but I am
struggling with the next step. I was suspecting the training vector created
in QGIS wasn't meeting proper standards, but I could not find a
straightforward Grass module for labeling segments/ creating a training set
file.

Hopefully someone can help me out.

Command output:

(Tue May 29 14:18:32 2018)

v.class.mlR -i --overwrite training_map=Training_Ben2@haarlooj_Ben_Test
segments_file=C:\Users\haarlooj\Documents\CELOS\Stats_Training_Ben_test
separator=comma
raster_segments_map=best_myregion1_at_haarlooj_Ben_Test_rank1@haarlooj_Ben_Test
train_class_column=code output_class_column=vote output_prob_column=prob
classifiers=svmRadial,rf,C5.0 folds=5 partitions=10 tunelength=10
weighting_modes=smv,qbwwv weighting_metric=accuracy
classification_results=X:\Projecten\Land-use Planning Marowijne\GIS en
RS\Werkfolder\GRASS\v.class.mIRR_optional_output\Ben_test_classifier-Results
accuracy_file=X:\Projecten\Land-use Planning Marowijne\GIS en
RS\Werkfolder\GRASS\v.class.mIRR_optional_output\Ben_Test_accuracy
model_details=X:\Projecten\Land-use Planning Marowijne\GIS en
RS\Werkfolder\GRASS\v.class.mIRR_optional_output\Ben_Test_ClassifierDetails
bw_plot_file=X:\Projecten\Land-use Planning Marowijne\GIS en
RS\Werkfolder\GRASS\v.class.mIRR_optional_output\Ben_test_classifier_performance
r_script_file=X:\Projecten\Land-use Planning Marowijne\GIS en
RS\Werkfolder\GRASS\v.class.mIRR_optional_output\Ben_test_R_script
processes=3
Running R now. Following output is R output.
Traceback (most recent call last):
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 633, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS7\addons/scri
pts/v.class.mlR.py", line 570, in main
subprocess.check_call(['Rscript', r_commands],
stderr=subprocess.STDOUT, )
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 537, in check_call
retcode = call(*popenargs, **kwargs)
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 524, in call
return Popen(*popenargs, **kwargs).wait()
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 711, in __init__
errread, errwrite)
  File "C:\Program Files\GRASS GIS
7.4.0\Python27\lib\subprocess.py", line 948, in
_execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file
specified
(Tue May 29 14:18:33 2018) Command finished (0 sec)


Best,
Jamille
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user