[GRASS-user] r.to.vect.lines addon not working

Hi all,

I'm facing problems with r.to.vect.lines addon module on different platforms (Fedora 23, Windows 10).

I compiled GRASS GIS 7 from svn source (updated right now to GRASS GIS 7.0.5svn R68347), see configuration at the end of the e-mail), then installed the addon using g.extension. Installing works fine, but when I run the command (either from GUI or command line) it provides me the following error:

--------------------

Traceback (most recent call last):
   File
"/usr/local/grass-7.0.4svn/gui/wxpython/gui_core/prompt.py",
line 263, in OnItemSelected

self.cmdDesc = gtask.parse_interface(cmd)
   File
"/usr/local/grass-7.0.4svn/etc/python/grass/script/task.py",
line 520, in parse_interface

"<{name}> module: {error}").format(name=name, error=error))
grass.exceptions
.
ScriptError
:
Cannot parse interface description of<r.to.vect.lines>
module: not well-formed (invalid token): line 17, column 19

---------------------

The last two lines also appear in grass shell when I launch GRASS 7.

I have no ideas about the origin of such error, any idea?

Thank you,

Carlo

--------------------

Informazioni di sistema
Versione di GRASS: 7.0.5svn
Revisione SVN GRASS: 68347
Build Date: 2016-05-02
Build Platform: x86_64-pc-linux-gnu
GDAL/OGR: 2.0.2
PROJ.4: 4.9.1
GEOS: 3.4.2
SQLite: 3.11.0
Python: 2.7.11
wxPython: 3.0.2.0
Piattaforma: Linux-4.4.8-300.fc23.x86_64-x86_64-with-fedora-23-Twenty_Three

Hi Carlo,

I just tried on my F23 box, no issues there.

Idea:

On Mon, May 2, 2016 at 10:14 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

Hi all,

I'm facing problems with r.to.vect.lines addon module on different platforms
(Fedora 23, Windows 10).

I compiled GRASS GIS 7 from svn source (updated right now to GRASS GIS
7.0.5svn R68347), see configuration at the end of the e-mail), then
installed the addon using g.extension. Installing works fine, but when I run
the command (either from GUI or command line) it provides me the following
error:

--------------------

Traceback (most recent call last):
  File
"/usr/local/grass-7.0.4svn/gui/wxpython/gui_core/prompt.py",

                             ^^^^should be 7.0.5svn in your case

Be sure that you run "make distclean" , then compile.

best
Markus

--
Markus Neteler
http://www.mundialis.de - free data with free software
http://grass.osgeo.org
http://courses.neteler.org/blog

Hi Markus,

Il 02/mag/2016 10:10 PM, “Markus Neteler” <neteler@osgeo.org> ha scritto:

Hi Carlo,

I just tried on my F23 box, no issues there.

Idea:

On Mon, May 2, 2016 at 10:14 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

“/usr/local/grass-7.0.4svn/gui/wxpython/gui_core/prompt.py”,
^^^^should be 7.0.5svn in your case

Be sure that you run “make distclean” , then compile.

best
Markus

My fault in copy-paste action. I didn’t “make distclean” at first version update, and then copied the error message from grass his output. I saw from system setting there was something wrong (grass gis 7.0.4). Then I compiled everything in the right way (make distclean, svn up, compile blablabla, make, make install) and checked add-on (working or not) once again, but didn’t replaced the error message (that was the same as the posted one) in mail text, sorry.

Anyway, I will make a double check tomorrow morning and will let you know (hopefully good news). I will try uninstalling and reinstalling the add-on.

Thank you,

Carlo

Good morning everybody,

a few minutes ago I removed r.to.vect.lines (g.extension -f extension=r.to.vect.lines operation=remove) and reinstalled it again, but get the same error once again:

···

Il 02/05/2016 22:33, CARLO CORMIO ha scritto:

Hi Markus,

Il 02/mag/2016 10:10 PM, “Markus Neteler” <neteler@osgeo.org> ha scritto:

Hi Carlo,

I just tried on my F23 box, no issues there.

Idea:

On Mon, May 2, 2016 at 10:14 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

“/usr/local/grass-7.0.4svn/gui/wxpython/gui_core/prompt.py”,
^^^^should be 7.0.5svn in your case

Be sure that you run “make distclean” , then compile.

best
Markus

My fault in copy-paste action. I didn’t “make distclean” at first version update, and then copied the error message from grass his output. I saw from system setting there was something wrong (grass gis 7.0.4). Then I compiled everything in the right way (make distclean, svn up, compile blablabla, make, make install) and checked add-on (working or not) once again, but didn’t replaced the error message (that was the same as the posted one) in mail text, sorry.

Anyway, I will make a double check tomorrow morning and will let you know (hopefully good news). I will try uninstalling and reinstalling the add-on.

Thank you,

Carlo

On Tue, May 3, 2016 at 9:26 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

Good morning everybody,

a few minutes ago I removed r.to.vect.lines (g.extension -f
extension=r.to.vect.lines operation=remove) and reinstalled it again, but
get the same error once again:

---------------

Traceback (most recent call last):
  File
"/usr/local/grass-7.0.5svn/gui/wxpython/gui_core/prompt.py",
line 263, in OnItemSelected

self.cmdDesc = gtask.parse_interface(cmd)
  File
"/usr/local/grass-7.0.5svn/etc/python/grass/script/task.py",
line 520, in parse_interface

"<{name}> module: {error}").format(name=name, error=error))
grass.exceptions
.
ScriptError
:
Cannot parse interface description of<r.to.vect.lines>
module: not well-formed (invalid token): line 17, column 19

Mhh.. can you please try

r.to.vect.lines --interface-description

and check if it outputs XML?

Markus

HI Markus,

Il 05/05/2016 16:57, Markus Neteler ha scritto:

Mhh.. can you please try

r.to.vect.lines --interface-description

and check if it outputs XML?

Markus

this is the result (xml):

--------------------------

GRASS 7.0.5svn (MonteMarioZona1_3003):~ > r.to.vect.lines --interface-description
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
<task name="r.to.vect.lines">
     <description>
         Convert raster rows to vector lines.
     </description>
     <keywords>
         raster, conversion, wiggles
     </keywords>
     <parameter name="input" type="string" required="yes" multiple="no">
         <description>
             Nome della mappa raster di input
         </description>
         <keydesc>
             <item order="1">name</item>
         </keydesc>
         <gisprompt age=""old" element="cell" prompt="raster";" />
     </parameter>
     <parameter name="output" type="string" required="yes" multiple="no">
         <description>
             Nome della mappa vettoriale di output
         </description>
         <keydesc>
             <item order="1">name</item>
         </keydesc>
         <gisprompt age=""new" element="vector" prompt="vector";" />
     </parameter>
     <parameter name="skip" type="integer" required="no" multiple="no">
         <description>
             Sample every Nth grid row
         </description>
         <default>
             10
         </default>
         <values>
             <value>
                 <name>1-100000</name>
             </value>
         </values>
     </parameter>
     <flag name="v">
         <description>
             Sample vertically (default is to sample horizontally)
         </description>
     </flag>
     <flag name="help">
         <description>
             Print usage summary
         </description>
     </flag>
     <flag name="verbose">
         <description>
             Output verboso del modulo
         </description>
     </flag>
     <flag name="quiet">
         <description>
             Output quieto del modulo
         </description>
     </flag>
</task>

ALso XML Copy Editor analysis provides the same error message:

Error at line 17, column 26: not well-formed (invalid token)

It seems there's something wrong with gisprompt, but I'm unable to understand and fix, sorry.

Thank you,

Carlo

Il 06/05/2016 15:50, Carlo Cormio ha scritto:

HI Markus,

Il 05/05/2016 16:57, Markus Neteler ha scritto:

Mhh.. can you please try

r.to.vect.lines --interface-description

and check if it outputs XML?

Markus

this is the result (xml):

--------------------------

GRASS 7.0.5svn (MonteMarioZona1_3003):~ > r.to.vect.lines --interface-description
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
<task name="r.to.vect.lines">
    <description>
        Convert raster rows to vector lines.
    </description>
    <keywords>
        raster, conversion, wiggles
    </keywords>
    <parameter name="input" type="string" required="yes" multiple="no">
        <description>
            Nome della mappa raster di input
        </description>
        <keydesc>
            <item order="1">name</item>
        </keydesc>
        <gisprompt age=""old" element="cell" prompt="raster";" />
    </parameter>
    <parameter name="output" type="string" required="yes" multiple="no">
        <description>
            Nome della mappa vettoriale di output
        </description>
        <keydesc>
            <item order="1">name</item>
        </keydesc>
        <gisprompt age=""new" element="vector" prompt="vector";" />
    </parameter>
    <parameter name="skip" type="integer" required="no" multiple="no">
        <description>
            Sample every Nth grid row
        </description>
        <default>
            10
        </default>
        <values>
            <value>
                <name>1-100000</name>
            </value>
        </values>
    </parameter>
    <flag name="v">
        <description>
            Sample vertically (default is to sample horizontally)
        </description>
    </flag>
    <flag name="help">
        <description>
            Print usage summary
        </description>
    </flag>
    <flag name="verbose">
        <description>
            Output verboso del modulo
        </description>
    </flag>
    <flag name="quiet">
        <description>
            Output quieto del modulo
        </description>
    </flag>
</task>

Hi,

2016-05-06 15:59 GMT+02:00 Carlo Cormio <carlo.cormio@gmail.com>:

ALso XML Copy Editor analysis provides the same error message:

Error at line 17, column 26: not well-formed (invalid token)

it seems to be here:

        <gisprompt age=""old" element="cell" prompt="raster";" />

the correct form is:

        <gisprompt age="old" element="cell" prompt="raster" />

Unfortunately I don't have time to investigate where the bug could be. Martin

            </value>
        </values>
    </parameter>
    <flag name="v">
        <description>
            Sample vertically (default is to sample horizontally)
        </description>
    </flag>
    <flag name="help">
        <description>
            Print usage summary
        </description>
    </flag>
    <flag name="verbose">
        <description>
            Output verboso del modulo
        </description>
    </flag>
    <flag name="quiet">
        <description>
            Output quieto del modulo
        </description>
    </flag>
</task>

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

On 5/6/16, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2016-05-06 15:59 GMT+02:00 Carlo Cormio <carlo.cormio@gmail.com>:

ALso XML Copy Editor analysis provides the same error message:

Error at line 17, column 26: not well-formed (invalid token)

it seems to be here:

        <gisprompt age=""old" element="cell" prompt="raster";" />

the correct form is:

        <gisprompt age="old" element="cell" prompt="raster" />

Fixed in r68382. Two wrong ";" chars removed (I suppose a leftover
from the related C syntax while this is Python).

Carlo, please try again.

Markus

MMMh, maybe I'm making a mess ...

I "make distclean" my GRASS GIS build, updated svn (svn up) to r68383, then compiled and make, but it says it's r68381.

Do I have to make something different to compile and install the righr revision?!

Thanks,

Carlo

Il 06/05/2016 16:57, Markus Neteler ha scritto:

On 5/6/16, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2016-05-06 15:59 GMT+02:00 Carlo Cormio <carlo.cormio@gmail.com>:

ALso XML Copy Editor analysis provides the same error message:

Error at line 17, column 26: not well-formed (invalid token)

it seems to be here:

         <gisprompt age=""old" element="cell" prompt="raster";" />

the correct form is:

         <gisprompt age="old" element="cell" prompt="raster" />

Fixed in r68382. Two wrong ";" chars removed (I suppose a leftover
from the related C syntax while this is Python).

Carlo, please try again.

Markus

On May 6, 2016 6:37 PM, “Carlo Cormio” <carlo.cormio@gmail.com> wrote:

MMMh, maybe I’m making a mess …

I “make distclean” my GRASS GIS build, updated svn (svn up) to r68383, then compiled and make, but it says it’s r68381.

Do I have to make something different to compile and install the righr revision?!

Just g.extension r…

Markus

Thanks,

Carlo

Il 06/05/2016 16:57, Markus Neteler ha scritto:

On 5/6/16, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2016-05-06 15:59 GMT+02:00 Carlo Cormio <carlo.cormio@gmail.com>:

ALso XML Copy Editor analysis provides the same error message:

Error at line 17, column 26: not well-formed (invalid token)

it seems to be here:

<gisprompt age=““old” element=“cell” prompt=“raster”;” />

the correct form is:

Fixed in r68382. Two wrong “;” chars removed (I suppose a leftover
from the related C syntax while this is Python).

Carlo, please try again.

Markus

Il 06/05/2016 18:55, Markus Neteler ha scritto:

Just g.extension r....

If so, I already tried before messing up everithing. The error appeared again.

GRASS GIS compiled and installed once again (svn up provided r68384), r.to.vect.lines removed and installed again, error appears again.

Ideas?

Thanks

Carlo

On Fri, May 6, 2016 at 1:14 PM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

Il 06/05/2016 18:55, Markus Neteler ha scritto:

Just g.extension r....

If so, I already tried before messing up everithing. The error appeared
again.

GRASS GIS compiled and installed once again (svn up provided r68384),
r.to.vect.lines removed and installed again, error appears again.

Try g.extension again, I hopefully fixed it.

Anna

Ideas?

Thanks

Carlo

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi Anna,

Il 06/05/2016 20:19, Anna Petrášová ha scritto:

Try g.extension again, I hopefully fixed it.

Anna

Interface appears now, but there's a new error message:

---------------

Traceback (most recent call last):
   File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
191, in <module>
     main()
   File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
96, in main
     data_type = Rast_get_map_type(inmap, mapset)
NameError: global name 'Rast_get_map_type' is not defined

---------------

Carlo

On Sat, May 7, 2016 at 5:04 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

Hi Anna,

Il 06/05/2016 20:19, Anna Petrášová ha scritto:

Try g.extension again, I hopefully fixed it.

Anna

Interface appears now, but there's a new error message:

---------------

Traceback (most recent call last):
  File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
191, in <module>
    main()
  File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
96, in main
    data_type = Rast_get_map_type(inmap, mapset)
NameError: global name 'Rast_get_map_type' is not defined

---------------

Carlo

Please, try again. The addon was apparently not ported to GRASS 7.

Anna

Works perfectly :slight_smile:

Thank you very much Anna, Markus, Martin.

Carlo

Il 07/05/2016 13:39, Anna Petrášová ha scritto:

On Sat, May 7, 2016 at 5:04 AM, Carlo Cormio <carlo.cormio@gmail.com> wrote:

Hi Anna,

Il 06/05/2016 20:19, Anna Petrášová ha scritto:

Try g.extension again, I hopefully fixed it.

Anna

Interface appears now, but there's a new error message:

---------------

Traceback (most recent call last):
   File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
191, in <module>
     main()
   File
"/home/ccormio/.grass7/addons/scripts/r.to.vect.lines", line
96, in main
     data_type = Rast_get_map_type(inmap, mapset)
NameError: global name 'Rast_get_map_type' is not defined

---------------

Carlo

Please, try again. The addon was apparently not ported to GRASS 7.

Anna