[GRASS5] [bug #2397] (grass) v.clean dissolve problem for areas

this bug's URL: http://intevation.de/rt/webrt?serial_num=2397
-------------------------------------------------------------------------

Subject: v.clean dissolve problem for areas

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: GRAS 5.7 CVS from april 2004

This problem occured a couple ot weeks ago using v.extract, but according
to Radim is a v.extract 'pseudo bug' and would have to be solved by v.clean.

  +----+------+
  | 1 | 2 |
  | c | |
  | +--+ c |
  | |c | |
  | |3 | |
  +----+--+---+

v.extract 1,2: result:

  +----+------+
  | 1 | 2 |
  | c | |
  | +--+ c |
  | | | |
  | | | |
  +----+--+---+

areas without centroid occur, because
former area 3 still is surrounded by boundaries and
2 areas but without centroid. To solve this, it would be necessary
to add a dissolve functionality into v.clean to add former area 3 to
one of the other areas (1 or 2).

hope the problem becomes clear

  thanks
   Otto

-------------------------------------------- Managed by Request Tracker

On Tuesday 04 May 2004 12:06, Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=2397
-------------------------------------------------------------------------

Subject: v.clean dissolve problem for areas

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: GRAS 5.7 CVS from april 2004

This problem occured a couple ot weeks ago using v.extract, but according
to Radim is a v.extract 'pseudo bug' and would have to be solved by
v.clean.

  +----+------+
  | 1 | 2 |
  | c | |
  | +--+ c |
  | |c | |
  | |3 | |
  +----+--+---+

v.extract 1,2: result:

  +----+------+
  | 1 | 2 |
  | c | |
  | +--+ c |
  | | | |
  | | | |
  +----+--+---+

This is obviously bug, correct is:

   +----+------+
   | 1 | 2 |
   | c | |
   | +--+ c |
   | | | |
   | | | |
   +----+ +---+

Are you sure that you get the wrong result above?
For me v.extract gives correct result.

areas without centroid occur, because
former area 3 still is surrounded by boundaries and
2 areas but without centroid. To solve this, it would be necessary
to add a dissolve functionality into v.clean to add former area 3 to
one of the other areas (1 or 2).

hope the problem becomes clear

No, not for me. What did I say about 'pseudo bug', dissolve functionality and v.clean?

Radim

Radim Blazek schrieb:

On Tuesday 04 May 2004 12:06, Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=2397
> -------------------------------------------------------------------------
>
> Subject: v.clean dissolve problem for areas
>
> Platform: GNU/Linux/i386
> grass obtained from: Trento Italy site
> grass binary for platform: Compiled from Sources
> GRASS Version: GRAS 5.7 CVS from april 2004
>
> This problem occured a couple ot weeks ago using v.extract, but according
> to Radim is a v.extract 'pseudo bug' and would have to be solved by
> v.clean.
>
> +----+------+
> | 1 | 2 |
> | c | |
> | +--+ c |
> | |c | |
> | |3 | |
> +----+--+---+
>
> v.extract 1,2: result:
>
> +----+------+
> | 1 | 2 |
> | c | |
> | +--+ c |
> | | | |
> | | | |
> +----+--+---+

This is obviously bug, correct is:

   +----+------+
   | 1 | 2 |
   | c | |
   | +--+ c |
   | | | |
   | | | |
   +----+ +---+

Are you sure that you get the wrong result above?
For me v.extract gives correct result.

> areas without centroid occur, because
> former area 3 still is surrounded by boundaries and
> 2 areas but without centroid. To solve this, it would be necessary
> to add a dissolve functionality into v.clean to add former area 3 to
> one of the other areas (1 or 2).
>
> hope the problem becomes clear

No, not for me. What did I say about 'pseudo bug', dissolve functionality and v.clean?

Hi Radim,

ok, sorry. I will try to show with the new spearfish57 data.

this is the original soils map from spearfish57

Number of nodes : 2181
Number of primitives: 2883
Number of points : 0
Number of lines : 0
Number of boundaries: 2146
Number of centroids : 737
Number of areas : 737
Number of isles : 42
Number of incorrect boundaries : 7

Then I extracted all areas with cat>20:
v.extract in=soils out=soils2 type=area,centroid where='cat>20'

Number of nodes : 1960
Number of primitives: 2484
Number of points : 0
Number of lines : 0
Number of boundaries: 1908
Number of centroids : 576
Number of areas : 595
Number of isles : 71
Number of areas without centroid : 19

in the resulting map centroids are missing, because some areas seem to
be
not correctly extracted. And you said 'some time ago' that this is not a
v.extract
problem and would have to be solved by adding a dissolve function to
v.clean, as
described with the upper figures.

  I hope it is clearer now?

     Otto

On Tuesday 04 May 2004 20:42, Otto Dassau wrote:

this is the original soils map from spearfish57

Number of nodes : 2181
Number of primitives: 2883
Number of points : 0
Number of lines : 0
Number of boundaries: 2146
Number of centroids : 737
Number of areas : 737
Number of isles : 42
Number of incorrect boundaries : 7

Then I extracted all areas with cat>20:
v.extract in=soils out=soils2 type=area,centroid where='cat>20'

Number of nodes : 1960
Number of primitives: 2484
Number of points : 0
Number of lines : 0
Number of boundaries: 1908
Number of centroids : 576
Number of areas : 595
Number of isles : 71
Number of areas without centroid : 19

in the resulting map centroids are missing, because some areas seem to be
not correctly extracted.

Are you sure that areas without centroids are not surrounded by
areas with cat>20? Any polygon closed by boundaries is area.
Category is used to identify areas you want.

And you said 'some time ago' that this is not a
v.extract problem and would have to be solved by adding a dissolve function to
v.clean, as described with the upper figures.

I hope I did not. 'dissolve' may be v.extract option, but does not make
sense for v.clean.

Radim

Radim Blazek schrieb:

On Tuesday 04 May 2004 20:42, Otto Dassau wrote:
> this is the original soils map from spearfish57
>
> Number of nodes : 2181
> Number of primitives: 2883
> Number of points : 0
> Number of lines : 0
> Number of boundaries: 2146
> Number of centroids : 737
> Number of areas : 737
> Number of isles : 42
> Number of incorrect boundaries : 7
>
> Then I extracted all areas with cat>20:
> v.extract in=soils out=soils2 type=area,centroid where='cat>20'
>
> Number of nodes : 1960
> Number of primitives: 2484
> Number of points : 0
> Number of lines : 0
> Number of boundaries: 1908
> Number of centroids : 576
> Number of areas : 595
> Number of isles : 71
> Number of areas without centroid : 19
>
> in the resulting map centroids are missing, because some areas seem to be
> not correctly extracted.

Are you sure that areas without centroids are not surrounded by
areas with cat>20? Any polygon closed by boundaries is area.
Category is used to identify areas you want.

Hi Radim,

No, you are right. Those areas are surrounded by boundaries of other
polygons. This
is my fault - sorry. But still, something with v.extract doesn't work
correctly.

Let me give you 2 examples:

a) If you look at soils2 output (example above), you can find some of
the
extracted areas (e.g. cat 9).
It doesn't have a centroid and is surrounded by other areas, so it is
extracted, but it is
still visualized as an area and obviously is an area without centroid
according to v.info.
I think normaly this area would have to be deleted, or not?

b) My second annotation is not a bug, but more a whish, and implements
what you already
described below. Would it be possible to use v.extract to dissolve small
areas and put them, e.g.
to the neighbour area it shares most of its boundary with?

> And you said 'some time ago' that this is not a
> v.extract problem and would have to be solved by adding a dissolve function to
> v.clean, as described with the upper figures.

I hope I did not. 'dissolve' may be v.extract option, but does not make
sense for v.clean.

Yes - I agree, you are right. I guess I misunderstood your last
explanations. But anyway, I
hope you now understand what I wanted to explain and maybe you have a
solution for these 2
problems?

  thank you
    Otto

On Wednesday 05 May 2004 09:16, Otto Dassau wrote:

Let me give you 2 examples:

a) If you look at soils2 output (example above), you can find some of
the extracted areas (e.g. cat 9).
It doesn't have a centroid and is surrounded by other areas, so it is
extracted, but it is still visualized as an area and obviously is
an area without centroid according to v.info.
I think normaly this area would have to be deleted, or not?

Again

> Any polygon closed by boundaries is area.

b) My second annotation is not a bug, but more a whish, and implements
what you already described below. Would it be possible to use v.extract to dissolve small
areas and put them, e.g. to the neighbour area it shares most of its boundary with?

Now I understand, that's correct wish.

Radim