Opened 13 years ago

Closed 10 years ago

#1418 closed defect (fixed)

v.dissolve not working

Reported by: hellik Owned by: grass-dev@…
Priority: major Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: Cc:
CPU: All Platform: All

Description

tested with WinGRASS-7.0.SVN-r47463-1-Setup.exe

there are a few issues with v.dissolve

(1) db.tables in $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db

db.tables --verbose                                                             
EU27_Biogeo_June08
bgr58fus
br05exploded
br05explodedl1
(Sat Aug 06 22:18:19 2011) Command finished (0 sec) 

(2) db.describe --verbose table=bgr58fus

column:bgr0508fus
description:
type:CHARACTER
len:75
scale:0
precision:0
default:
nullok:yes
select:?
update:?

(3) v.dissolve from the wxgui

Traceback (most recent call last):
  File "C:\Program Files\GRASS
7.0.SVN\etc\gui\wxpython\wxgui.py", line 536, in OnMenuCmd

menuform.GUI(parent = self).ParseCommand(cmd)
  File "C:\Program Files\GRASS
7.0.SVN\etc\gui\wxpython\gui_modules\menuform.py", line
1878, in ParseCommand

blackList = _blackList)
  File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc-
mingw32/etc/python/grass/script/task.py", line 451, in
parse_interface
  File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc-
mingw32/etc/python/grass/script/task.py", line 438, in
get_interface_description
grass.script.core
.
ScriptError
:
u'Unable to fetch interface description for command
\'v.dissolve\'.\n\nDetails: Traceback (most recent call
last):\r\n  File "C:\\Program Files\\GRASS
7.0.SVN\\scripts\\v.dissolve.py", line 39, in <module>\r\n
import grass.script as grass\r\n  File "C:\\Program
Files\\GRASS
7.0.SVN\\etc\\python\\grass\\script\\__init__.py", line 1,
in <module>\r\n    from core   import *\r\n  File
"C:\\Program Files\\GRASS
7.0.SVN\\etc\\python\\grass\\script\\core.py", line 31, in
<module>\r\n    import subprocess\r\n  File "C:\\Program
Files\\GRASS 7.0.SVN\\Python25\\lib\\subprocess.py", line
376, in <module>\r\n    import threading\r\n  File
"C:\\Program Files\\GRASS
7.0.SVN\\Python25\\lib\\threading.py", line 13, in
<module>\r\n    from collections import
deque\r\nImportError: No module named collections\r\n'

(4) from the wxgui-command console

Traceback (most recent call last):
  File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc-
mingw32/etc/gui/wxpython/gui_modules/prompt.py", line 803,
in OnItemSelected
  File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc-
mingw32/etc/python/grass/script/task.py", line 451, in
parse_interface
  File "c:/osgeo4w/usr/src/grass_trunk/dist.i686-pc-
mingw32/etc/python/grass/script/task.py", line 438, in
get_interface_description
grass.script.core
.
ScriptError
:
u'Unable to fetch interface description for command
\'v.dissolve\'.\n\nDetails: Traceback (most recent call
last):\r\n  File "C:\\Program Files\\GRASS
7.0.SVN\\scripts\\v.dissolve.py", line 39, in <module>\r\n
import grass.script as grass\r\n  File "C:\\Program
Files\\GRASS
7.0.SVN\\etc\\python\\grass\\script\\__init__.py", line 1,
in <module>\r\n    from core   import *\r\n  File
"C:\\Program Files\\GRASS
7.0.SVN\\etc\\python\\grass\\script\\core.py", line 31, in
<module>\r\n    import subprocess\r\n  File "C:\\Program
Files\\GRASS 7.0.SVN\\Python25\\lib\\subprocess.py", line
376, in <module>\r\n    import threading\r\n  File
"C:\\Program Files\\GRASS
7.0.SVN\\Python25\\lib\\threading.py", line 13, in
<module>\r\n    from collections import
deque\r\nImportError: No module named collections\r\n'

(5) and in the wingrass70-windows-commandline

GRASS 7.0.svn> v.dissolve.py input=bgr58fus layer=1 column=bgr0508fus output=bgrdis
DBMI-SQLite driver error:
Cannot step:
SQL logic error or missing database

FEHLER: Kann Daten nicht aus der Tabelle <bgr58fus> holen.
FEHLER: Vektorkarte <bgrdis> nicht gefunden.
GRASS 7.0.svn>

there seems to be some issue with the sqlite-database

best regards Helmut

Change History (8)

comment:1 by hellik, 13 years ago

Summary: WinGrass7 - v,dissolve not workingWinGrass7 - v.dissolve not working

in reply to:  description comment:2 by hellik, 13 years ago

Replying to hellik:

GRASS 7.0.svn> v.dissolve.py input=bgr58fus layer=1 column=bgr0508fus output=bgrdis
DBMI-SQLite driver error:
Cannot step:
SQL logic error or missing database

FEHLER: Kann Daten nicht aus der Tabelle <bgr58fus> holen.
FEHLER: Vektorkarte <bgrdis> nicht gefunden.
GRASS 7.0.svn>

there seems to be some issue with the sqlite-database

also tested with WinGRASS-6.4.SVN-r47456-1-Setup.exe with the sql-db-backend:

v.dissolve --verbose input=bgr58fus@data output=dissg7 column=bgr0508fus        
DBMI-SQLite driver error:
Cannot step:
SQL logic error or missing database
ERROR: Kann Daten nicht aus der Tabelle <bgr58fus> holen.
ERROR: Kann die Vektorkarte <dissg7_10720@data> nicht auf Level 2 öffnen. Versuchen Sie die Topologie mit v.build neu anzulegen.
Kann Datei 'C:\gisdata\grassdata/bgrffh/data/vector/dissg7_10720/coor' nicht löschen.
couldn't be removed
<dissg7_10720> nothing removed
ERROR: Vektorkarte <dissg7> im aktuellen Mapset nicht gefunden.
(Sat Aug 06 23:45:28 2011) Command finished (7 sec)               

I've tried the same in wingrass64 with dbf as db-backend, v.dissolve is working.

Helmut

comment:3 by neteler, 13 years ago

CPU: x86-32All
Keywords: wingrass removed
Platform: MSWindows VistaAll
Summary: WinGrass7 - v.dissolve not workingv.dissolve not working

v.dissolve also silently fails on Linux as no effect is taken on the resulting map (also, one less area than in GRASS 6.4.svn):

North Carolina dataset:

GRASS 6.4.2svn (nc_spm_08):~ > v.dissolve zipcodes_wake out=zip_name
Building topology for vector map <zip_names_10469>...
Registering primitives...
206 primitives registered
14517 vertices registered
Building areas...
 100%
48 areas built
2 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 160
Number of primitives: 206
Number of points: 0
Number of lines: 0
Number of boundaries: 158
Number of centroids: 48
Number of areas: 48
Number of isles: 2
v.reclass complete. 48 features reclassed.
Extracting features...
Building topology for vector map <zip_names>...
Registering primitives...
162 primitives registered
11115 vertices registered
Building areas...
 100%
27 areas built
2 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 137
Number of primitives: 162
Number of points: 0
Number of lines: 0
Number of boundaries: 114
Number of centroids: 48
Number of areas: 27
Number of isles: 2
Number of duplicate centroids: 21
Writing attributes...
v.extract complete.
Removing duplicate centroids...
Building topology for vector map <zip_names>...
Registering primitives...
141 primitives registered
11094 vertices registered
Building areas...
 100%
27 areas built
2 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 116
Number of primitives: 141
Number of points: 0
Number of lines: 0
Number of boundaries: 114
Number of centroids: 27
Number of areas: 27
Number of isles: 2

-> 48 areas reduced to 27 areas, look ok but:

GRASS 7.0.svn (nc_spm_08@grass70):~ > v.dissolve myzipcodes_wake out=zip_name
Extracting features...
 100%
Building topology for vector map <zip_name@grass70>...
Registering primitives...
205 primitives registered
14515 vertices registered
Building areas...
 100%
47 areas built
2 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 112
Number of primitives: 205
Number of points: 0
Number of lines: 0
Number of boundaries: 157
Number of centroids: 48
Number of areas: 47
Number of isles: 2
Number of duplicate centroids: 1
Writing attributes...
Removing duplicate centroids...
Building topology for vector map <zip_name@grass70>...
Registering primitives...
204 primitives registered
14514 vertices registered
Building areas...
 100%
47 areas built
2 isles built
Attaching islands...
 100%
Attaching centroids...
 100%
Number of nodes: 112
Number of primitives: 204
Number of points: 0
Number of lines: 0
Number of boundaries: 157
Number of centroids: 47
Number of areas: 47
Number of isles: 2

-> 47 (!) areas remain 47 areas

comment:4 by neteler, 13 years ago

The bug is probably triggered by #548 (v.reclass + SQLite failure, but errors are suppressed in v.dissolve).

in reply to:  4 comment:5 by mmetz, 13 years ago

Replying to neteler:

The bug is probably triggered by #548 (v.reclass + SQLite failure, but errors are suppressed in v.dissolve).

See ticket #548, comment 12 http://trac.osgeo.org/grass/ticket/548#comment:12

Markus M

in reply to:  3 comment:6 by martinl, 10 years ago

Replying to neteler:

v.dissolve also silently fails on Linux as no effect is taken on the resulting map (also, one less area than in GRASS 6.4.svn):

when you don't defined 'column' option, features are dissolved based on category. I have added warning about that in r59375.

North Carolina dataset:

> GRASS 6.4.2svn (nc_spm_08):~ > v.dissolve zipcodes_wake out=zip_name
> Number of areas: 27
> Number of isles: 2

-> 48 areas reduced to 27 areas, look ok but:

this is probably typo I am getting 47 areas also in G6, you probably missed column=ZIPNAME. It seems to me that there is no difference in results produced in G6 or G7.

G6 & G7:

v.dissolve in=zipcodes_wake out=zip_names --o -> 47
v.dissolve in=zipcodes_wake out=zip_names --o column=ZIPNAME -> 27

comment:7 by martinl, 10 years ago

Can we close the ticket than?

in reply to:  7 comment:8 by hellik, 10 years ago

Resolution: fixed
Status: newclosed

Replying to martinl:

Can we close the ticket than?

closing ticket.

Note: See TracTickets for help on using tickets.