[GRASS5] [bug #875] (grass) v.reclass does nothing...

Hi Eric,

I tried again today, but v.reclass still produces in=out results.
The same procedure works well with raster maps (using Spearfish,
note that I am *not* in PERMANENT mapset):

cat fields.recl
1 thru 62 = 1 private
63 = 2 Black Hills Natl. Forest

cat fields.recl | r.reclass fields out=fields.recl
d.rast fields
d.rast fields.recl
-> result is fine

cat fields.recl | v.reclass fields type=area out=fields.recl
v.support fields.recl
d.area -f fields
d.area -f fields.recl
-> result is identical - oops.

Is it possible for you to try my example? Would be great...

Thanks,

Markus

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

Hi,

it seems to me that v.reclass works as it is supposed
to in your example:

cat fields.recl | v.reclass fields out=fields.recl
type=area

here is the result query d.what.vect output:

-------------
Buttons
Left: what's here
Right: quit

606242.1(E) 4924342(N)
     fields in PERMANENT Line - Category <not tagged>
Area - Category 41 D. Portillo#1
Size - Sq Meters: 5034387.990 Hectares: 503.439
           Acres: 1243.994 Sq Miles: 1.9437
fields.recl in user1 Line - Category <not tagged>
Area - Category 1 private
Size - Sq Meters: 5034387.990 Hectares: 503.439
           Acres: 1243.994 Sq Miles: 1.9437

596637(E) 4918350.7(N)
     fields in PERMANENT Area - Category 63 Black
Hills Natl. Forest
Size - Sq Meters: 116514876.800 Hectares: 11651.488
           Acres: 28790.754 Sq Miles: 44.9856
fields.recl in user1 Area - Category 2 Black
Hills Natl. Forest
Size - Sq Meters: 116514876.800 Hectares: 11651.488
           Acres: 28790.754 Sq Miles: 44.9856
---------------

So actually there are only 2 categories in fields.recl

However, when you run d.area, the function plot1 has
this:
-------------

if (colorcycle)
                {
                  color_number=color_number + 1;
                  if (color_number == backgroundcolor)
                     color_number=color_number + 1;
                  if (color_number > MAX_COLOR_NUM)
                     color_number=1;
                  if (color_number == backgroundcolor)
                     color_number=color_number + 1;
                     
                  R_standard_color(color_number);
                }
                else
                  R_color(fillcolor);

                R_polygon_abs(x_screen, y_screen, i);
-----------------------
Each polygon would be colored differently (even those
having the same new category) in d.area.

You can try -d option with v.reclass and get fewer
colors in the result map, but not two. This is what I
think strange (bug?).

To get only two polygons in the result d.area, perhaps
you'd better use v.extract with -d.

--alex

--- Markus Neteler via RT <grass-bugs@intevation.de>
wrote:

Hi Eric,

I tried again today, but v.reclass still produces
in=out results.
The same procedure works well with raster maps
(using Spearfish,
note that I am *not* in PERMANENT mapset):

cat fields.recl
1 thru 62 = 1 private
63 = 2 Black Hills Natl. Forest

cat fields.recl | r.reclass fields out=fields.recl
d.rast fields
d.rast fields.recl
-> result is fine

cat fields.recl | v.reclass fields type=area
out=fields.recl
v.support fields.recl
d.area -f fields
d.area -f fields.recl
-> result is identical - oops.

Is it possible for you to try my example? Would be
great...

Thanks,

Markus

-------------------------------------------- Managed
by Request Tracker
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

Hi Alex,

On Thu, Dec 20, 2001 at 03:03:20AM -0800, Alex Shevlakov wrote:

Hi,

it seems to me that v.reclass works as it is supposed
to in your example:

cat fields.recl | v.reclass fields out=fields.recl
type=area

here is the result query d.what.vect output:

[...]

So actually there are only 2 categories in fields.recl

you are right! Thanks for the good news, it seems I was confused by
two facts

- d.area colors according to the polygon number, not the category
   number
   Maybe we want a flag "-c" to color according to the categorry numbers
   and not to the polygon numbers?

- v.reclass does not eliminate boundaries properly when two adjacent
   polygons are assigned to the same category, as you also say.

[...]

Each polygon would be colored differently (even those
having the same new category) in d.area.

Sorry for this, as I have implemented that flag in d.area
I should have known (oops :slight_smile:

So
d.vect.labels fields.recl
runs well.

You can try -d option with v.reclass and get fewer
colors in the result map, but not two. This is what I
think strange (bug?).

Yes, this is *really* a bug. "-d" also damages the topology
in the current implementation as open polygons occur.

To get only two polygons in the result d.area, perhaps
you'd better use v.extract with -d.

Yes - my intention was to test v.reclass.

Thanks for your hints,

Markus

--- Markus Neteler via RT <grass-bugs@intevation.de>
wrote:
> Hi Eric,
>
> I tried again today, but v.reclass still produces
> in=out results.
> The same procedure works well with raster maps
> (using Spearfish,
> note that I am *not* in PERMANENT mapset):
>
> cat fields.recl
> 1 thru 62 = 1 private
> 63 = 2 Black Hills Natl. Forest
>
> cat fields.recl | r.reclass fields out=fields.recl
> d.rast fields
> d.rast fields.recl
> -> result is fine
>
> cat fields.recl | v.reclass fields type=area
> out=fields.recl
> v.support fields.recl
> d.area -f fields
> d.area -f fields.recl
> -> result is identical - oops.
>
> Is it possible for you to try my example? Would be
> great...
>
> Thanks,
>
> Markus
>
>
> -------------------------------------------- Managed
> by Request Tracker
> _______________________________________________
> grass5 mailing list
> grass5@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Markus Neteler

ITC-irst, Istituto per la Ricerca Scientifica e Tecnologica
     Project on Predictive Models for the Environment
Via Sommarive, 18 - 38050 Povo (Trento), Italia
tel +39 0461 314 -520 (fax -591) http://mpa.itc.it

On Thu, 20 Dec 2001 12:17:43 +0100, Markus Neteler <neteler@itc.it> wrote:

> You can try -d option with v.reclass and get fewer
> colors in the result map, but not two. This is what I
> think strange (bug?).

Yes, this is *really* a bug. "-d" also damages the topology
in the current implementation as open polygons occur.

Can you provide an example? As far as I can tell, the
resulting topology from your "fields" reclass example
looks just fine. I did not see any unclosed areas, or stray
line work... Note, none of the "open" areas in the reclass
that are shown as polygons in the original 'fields' are
labelled. Therefore, they can't be reclassed...

> To get only two polygons in the result d.area, perhaps
> you'd better use v.extract with -d.

It'd be impossible to get two polygons from the example
in the test. Compare with the original data. There
are double lines bordering "adjacent" parcels in some
cases. Presumably, these are "rights of way" for roads...
Indeed they are...

Yes - my intention was to test v.reclass.

I think it is working properly. That there are problems
in the v.support/v.build realm is undisputed (does not always
properly intersect lines and form new nodes, for instance).

--
Eric G. Miller <egm2@jps.net>

--- "Eric G. Miller" <egm2@jps.net> wrote:

It'd be impossible to get two polygons from the
example
in the test. Compare with the original data. There
are double lines bordering "adjacent" parcels in
some
cases. Presumably, these are "rights of way" for
roads...
Indeed they are...

Yes, these tiny double lines seen in the microscope..

They justify the areas not been reclassed together.

We can put away the v.reclass bug from the RT, I
think.

--alex

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com