[GRASS-dev] vector dissolve problems

Hamish hamish_nospam at yahoo.com
Wed Nov 15 23:56:10 EST 2006


Markus:
> I try to merge the 100km tiles of the CORINE vector
> landcover maps which are delivered in SHAPE format.
>
> Due to the tiling there are annoying boundaries now
> when patching the tiles together. I then tried to
> reclass and dissolve them based on the landuse
> code to no avail.
..
> # dissolve 
> v.extract -d clc2000_tn_bl_recl out=clc2000_tn_bl_dissolved


v.extract -d type=area
            ^^^^^^^^^^^

then it works with box.asc. Note this is what the v.dissolve script
does already: your box.asc dissolves correctly with v.dissolve,
including preserving the boundary's cat number(s).


without type=area, it decides to keep the boundary here:
vector/v.extract/extract.c  line ~ 271
     else if ( type_only && field > 0 ) /* type and field only */
     {
	 /* line */
	 if ( type_match && field_match ) write = 1; 

it correctly skips writing the boundary as part of an AREA due to the
dissolve, but decides to write it anyway as a BDY as it is a categorized
feature.


I'm not convinced this is a bug. v.extract is doing what you told it to do.
(type= default: point,line,boundary,centroid,area,face [with cat])


FWIW, some debug msgs:
when boundary has a cat, field_match is set to 1:  (field==layer)
  field_match = Vect_cat_get(Line_Cats_Old,field,&tmp);

box.asc  (line 4 is your boundary cat 2)
D2/2: line = 4   field=1   type_only=1
D2/2: type_match = 1 field_match = 1 cat_match = 0
D2/2: left_area = 1 left_field_match = 1 left_cat_match = 0
D2/2: right_area = 2 right_field_match = 1 right_cat_match = 0
D2/2: writing line 4.  LINE (field 1)
D2/2: write = 1

box.asc with boundary cats removed.
D2/2: line = 4   field=1   type_only=1
D2/2: type_match = 1 field_match = 0 cat_match = 0
D2/2: left_area = 1 left_field_match = 1 left_cat_match = 0
D2/2: right_area = 2 right_field_match = 1 right_cat_match = 0
D2/2: write = 0



Hamish




More information about the grass-dev mailing list