[GRASS-user] vdigit - grass-6.4.0.RC5

Hi,

Vdigit doesn’t work yet on my system.

When I launch vdigit, the Grass GIS display turn right in the vdigit window. But when selecting a vector map, i get the message :

Traceback (most recent call last):
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1071, in OnSelectMap

self.StartEditing(self.layers[selection])
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1103, in StartEditing

self.parent.digit = Digit(mapwindow=self.parent.MapWindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 685, in __init__

VDigit.__init__(self, mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 223, in __init__

mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/vdigit/grass6
_wxvdigit.py", line 333, in __init__

this = _grass6_wxvdigit.new_Digit(*args)
TypeError
:
in method 'new_Digit', argument 2 of type 'wxWindow *'

When trying to add, move, … a feature, I get a warning window that say : ‘no map selected for edition’ (but in French)

No more access to the parameters window (same message as above)

My system :

Fedora 11, Linux kernel 2.6.30.5-43.fc11.i686.PAE #1 SMP
Grass-6.4.0.RC5
Python 2.6
wx-config : 2.8.10

grass compiled with : ./configure --with-x --with-cxx --with-postgres --with-sqlite --with-blas --with-lapack --with-freetype --with-python=/usr/bin/python-config --with-gdal --with-proj-share=/usr/share/proj/ --with-freetype-includes=/usr/include/freetype2/ --with-wxwidgets=/usr/bin/wx-config --with-motif --with-cairo --with-nls --enable-shared --with-opengl --enable-largefile --with-glw --with-readline

Perhaps a problem in my config ?

Anyone an idea ?

Thanks for this wonderfull GIS

Benoit.


Benoit ANDRE
Géologue - Hydrologue


Bureau Conseil en Géologie sprl
Rue de Leuze, 433
B-5300 VEZIN
BELGIQUE

Tél.: +32 81 58 26 11
Fax.: +32 81 58 26 12
Mobile : +32 475 61 84 94
Contacter…
Bureau Conseil en Géologie


Hi,

2009/9/16 Benoit ANDRE <benoit.andre@bcgeol.be>

Hi,

Vdigit doesn’t work yet on my system.

When I launch vdigit, the Grass GIS display turn right in the vdigit window. But when selecting a vector map, i get the message :

Traceback (most recent call last):
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1071, in OnSelectMap

self.StartEditing(self.layers[selection])
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1103, in StartEditing

self.parent.digit = Digit(mapwindow=self.parent.MapWindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 685, in __init__

VDigit.__init__(self, mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 223, in __init__

mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/vdigit/grass6
_wxvdigit.py", line 333, in __init__

this = _grass6_wxvdigit.new_Digit(*args)
TypeError
:
in method 'new_Digit', argument 2 of type 'wxWindow *'

When trying to add, move, … a feature, I get a warning window that say : ‘no map selected for edition’ (but in French)

It can be caused with the fact that used different Swig version for building vector digitizer extension compared to the version used for building wxPython library…

Martin


Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Hi Martin,

Thanks for your response. The problem is effectively swig.

I’m using Fedora 11,

wxWidgets (wxGTK) 2.8.10
wxPython 2.8.9.2-2
By default, version of swig is 1.3.39 in FC11. I’ve recompiled the wxWidget and wxPython package from SRPMS, but the problem persists.

Thus, I retrograded to swig 1.3.35 (and, of course, recompilation of wxPython) and everythings is now OK. Vdigit works perfectly.

It seems to be a problem with swig 1.3.39

Benoit.

Le samedi 19 septembre 2009 à 18:29 +0200, Martin Landa a écrit :

Hi,

2009/9/16 Benoit ANDRE <benoit.andre@bcgeol.be>

Hi,

Vdigit doesn’t work yet on my system.

When I launch vdigit, the Grass GIS display turn right in the vdigit window. But when selecting a vector map, i get the message :

Traceback (most recent call last):
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1071, in OnSelectMap

self.StartEditing(self.layers[selection])
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/t
oolbars.py", line 1103, in StartEditing

self.parent.digit = Digit(mapwindow=self.parent.MapWindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 685, in __init__

VDigit.__init__(self, mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/gui_modules/v
digit.py", line 223, in __init__

mapwindow)
  File "/usr/local/grass-6.4.0RC5/etc/wxpython/vdigit/grass6
_wxvdigit.py", line 333, in __init__

this = _grass6_wxvdigit.new_Digit(*args)
TypeError
:
in method 'new_Digit', argument 2 of type 'wxWindow *'

When trying to add, move, … a feature, I get a warning window that say : ‘no map selected for edition’ (but in French)

It can be caused with the fact that used different Swig version for building vector digitizer extension compared to the version used for building wxPython library…

Martin


Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa


Benoit ANDRE
Géologue - Hydrologue


Bureau Conseil en Géologie sprl
Rue de Leuze, 433
B-5300 VEZIN
BELGIQUE

Tél.: +32 81 58 26 11
Fax.: +32 81 58 26 12
Mobile : +32 475 61 84 94
Contacter…
Bureau Conseil en Géologie


Hi,

from a raster map I get vector polygons with r.to.vect.
As I use the -v flag, I get one category-number for each value. This is
what I want.

My problem: v.to.db does not update negative cats! Is there any way to
handle this?

I dont want to loose the identification, nor miss the -v Flag: Having
raster-values in a column "value" is not clean, due to the fact, that I
have eg. to remove small trapped cells, calc center of gravity and more.

Thanks,
Achim

Achim wrote:

from a raster map I get vector polygons with r.to.vect.
As I use the -v flag, I get one category-number for each
value. This is what I want.

My problem: v.to.db does not update negative cats! Is there
any way to handle this?

I dont want to loose the identification, nor miss the -v Flag: Having
raster-values in a column "value" is not clean, due to the fact, that I
have eg. to remove small trapped cells, calc center of gravity and more.

the key column ID is meant to be a positive number. attribute columns can
be whatever you like.

You can keep a form of the number positive with r.mapcalc, e.g.:

r.mapcalc "pos_map = if( orig_map <= 0, 100000 - orig_map, orig_map )"

then -5 becomes 100005, etc.

some SQL magic can add a new column for the vector map and repopulate it
with the original +/- values.

Hamish

Hi Hamish,

thanks! I did like you said and it works fine.

Because the database (sqlite) has its own ids, it can handle the grass
internal cats even when they are negative.
Multiplying forward and backward let me identify old numbers.

I was a bit afraid, that the numbers result are to hight, because I used
three different kinds of objects coded as positive, negative and
negative multiplied with 100000.

Achim

Hamish schrieb:

Achim wrote:

from a raster map I get vector polygons with r.to.vect.
As I use the -v flag, I get one category-number for each
value. This is what I want.

My problem: v.to.db does not update negative cats! Is there
any way to handle this?

I dont want to loose the identification, nor miss the -v Flag: Having
raster-values in a column "value" is not clean, due to the fact, that I
have eg. to remove small trapped cells, calc center of gravity and more.

the key column ID is meant to be a positive number. attribute columns can
be whatever you like.

You can keep a form of the number positive with r.mapcalc, e.g.:

r.mapcalc "pos_map = if( orig_map <= 0, 100000 - orig_map, orig_map )"

then -5 becomes 100005, etc.

some SQL magic can add a new column for the vector map and repopulate it
with the original +/- values.

Hamish

Hi grass-users,

I am going to measure the distance from one centroid to another for many
polygons in a layer in order to update the table with the distance.

What would be a way? The only I can imagine so far is:
- collecting coordinates
- building lines from them
- update length of lines
- update old table

Is there another, better and faster way? Shouldn't be measuring of
distances a common tool? Do I just don't find it? Do I understand
v.distance wrong (it just returns the cat of the nearest feature)?

Achim

Hi,

I did it the long-way. Here you are (here I am):
-defining, whats the "next" polygon
-updating table with coordinates of centroids
-and the centroids of the next
-writing these informations and cats number out
-building standard-ascii-lines-import file with a bit of awk
-import that
-building table (with stored category-numbers)
-adding column "length"
-v.to.db option=length
-update original table

Achim

Achim Kisseler schrieb:

Hi grass-users,

I am going to measure the distance from one centroid to another for many
polygons in a layer in order to update the table with the distance.

What would be a way? The only I can imagine so far is:
- collecting coordinates
- building lines from them
- update length of lines
- update old table

Is there another, better and faster way? Shouldn't be measuring of
distances a common tool? Do I just don't find it? Do I understand
v.distance wrong (it just returns the cat of the nearest feature)?

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

note that the centroids can legally be placed anywhere within the area's
boundary, so measuring distances between them gives a constrained, but
mostly meaningless result.

if you really want to do it, the method I'd have used would be v.type +
v.distance.

shrug,
Hamish

Achim wrote:

I did it the long-way. Here you are (here I am):
-defining, whats the "next" polygon
-updating table with coordinates of centroids
-and the centroids of the next
-writing these informations and cats number out
-building standard-ascii-lines-import file with a bit of awk
-import that
-building table (with stored category-numbers)
-adding column "length"
-v.to.db option=length
-update original table

Achim

Achim Kisseler schrieb:
> Hi grass-users,
>
> I am going to measure the distance from one centroid
to another for many
> polygons in a layer in order to update the table with
the distance.
>
> What would be a way? The only I can imagine so far
is:
> - collecting coordinates
> - building lines from them
> - update length of lines
> - update old table
>
> Is there another, better and faster way? Shouldn't be
measuring of
> distances a common tool? Do I just don't find it? Do I
understand
> v.distance wrong (it just returns the cat of the
nearest feature)?
>
> Achim