running the addon script [1] in normal and --verbose mode:
v.fixed.segmentpoints vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:36:52 2014) Befehl ausgeführt (43 Sek)
v.fixed.segmentpoints --verbose vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:39:03 2014) Befehl ausgeführt (35 Sek)
it works.
but in --quiet mode it fails with:
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in <module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
running the addon script [1] in normal and --verbose mode:
v.fixed.segmentpoints vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:36:52 2014) Befehl ausgeführt (43 Sek)
v.fixed.segmentpoints --verbose vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:39:03 2014) Befehl ausgeführt (35 Sek)
it works.
but in --quiet mode it fails with:
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in <module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
Could you try to print tmp with and without quiet?
running the addon script [1] in normal and --verbose mode:
v.fixed.segmentpoints vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:36:52 2014) Befehl ausgeführt (43 Sek)
v.fixed.segmentpoints --verbose vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Extract vector line for which segment points should be calculated ...
[...]
----
v.fixed.segmentpoints done!
(Thu Nov 13 21:39:03 2014) Befehl ausgeführt (35 Sek)
it works.
but in --quiet mode it fails with:
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in <module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
I don't understand the details, but I think that --quiet somehow suppresses the access to the output of your grass.read_command('v.to.db', ...).
I've had similar issues with pipe_command for v.centerline. So I played with the GRASS_VERBOSE env variable. See [1].
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in
<module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
Could you try to print tmp with and without quiet?
it's just to get the length of the vector line for further calculations:
in normal and verbose mode:
----
Lese Objekte...
Vector line length in meter:
58858.3366368
----
as Moritz points out, it seems quiet mode suppresses the access to the
output of grass.read_command; his solution/workaround with GRASS_VERBOSE env
variable seems not to work here on my side.
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in
<module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
Could you try to print tmp with and without quiet?
it's just to get the length of the vector line for further calculations:
in normal and verbose mode:
----
Lese Objekte...
Vector line length in meter:
58858.3366368
----
as Moritz points out, it seems quiet mode suppresses the access to the
output of grass.read_command; his solution/workaround with GRASS_VERBOSE env
variable seems not to work here on my side.
I'm afraid that --quiet supersedes any settings in the code, but am not sure.
On Fri, Nov 14, 2014 at 6:37 AM, Moritz Lennert <
mlennert@club.worldonline.be> wrote:
On 14/11/14 10:25, Helmut Kudrnovsky wrote:
Anna Petrášová wrote
but in --quiet mode it fails with:
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in
<module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
Could you try to print tmp with and without quiet?
it's just to get the length of the vector line for further calculations:
in normal and verbose mode:
----
Lese Objekte...
Vector line length in meter:
58858.3366368
----
as Moritz points out, it seems quiet mode suppresses the access to the
output of grass.read_command; his solution/workaround with GRASS_VERBOSE
env
variable seems not to work here on my side.
I'm afraid that --quiet supersedes any settings in the code, but am not
sure.
So how about setting quiet=False when calling v.to.db? Anyway I don't
think quiet causes read_command to be completely silent, just run
On Fri, Nov 14, 2014 at 9:47 AM, Anna Petrášová <kratochanna@gmail.com>
wrote:
On Fri, Nov 14, 2014 at 6:37 AM, Moritz Lennert <
mlennert@club.worldonline.be> wrote:
On 14/11/14 10:25, Helmut Kudrnovsky wrote:
Anna Petrášová wrote
but in --quiet mode it fails with:
v.fixed.segmentpoints --quiet vector=iselflipped@myricaria cat=1
dir=C:\tmp\grassscript distance=25000
Traceback (most recent call last):
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 226, in
<module>
sys.exit(main())
File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons/scr
ipts/v.fixed.segmentpoints.py", line 100, in main
vector_line_length =
float(tmp.split('\n')[1].split('|')[1])
IndexError: list index out of range
(Thu Nov 13 21:40:08 2014) Befehl ausgeführt (2 Sek)
any idea?
Could you try to print tmp with and without quiet?
it's just to get the length of the vector line for further calculations:
in normal and verbose mode:
----
Lese Objekte...
Vector line length in meter:
58858.3366368
----
as Moritz points out, it seems quiet mode suppresses the access to the
output of grass.read_command; his solution/workaround with GRASS_VERBOSE
env
variable seems not to work here on my side.
I'm afraid that --quiet supersedes any settings in the code, but am not
sure.
So how about setting quiet=False when calling v.to.db? Anyway I don't
think quiet causes read_command to be completely silent, just run
On Fri, Nov 14, 2014 at 10:05 AM, Anna Petrášová <kratochanna@gmail.com>
wrote:
It's because of the header line:
cat|length
1|572.767146965659
but in quiet mode you get:
1|572.767146965659
so I would suggest set quiet=True for v.to.db and change the code for
parsing to expect just one line.
--quiet and --verbose should change the level of verbosity of messages
(additional info and/or diagnostic). However, if header is included or not
is question of the (output) format which should be same unless explicitly
changed. A flag should be there to include or not include the header. I
think there is a bug in v.to.db.