[GRASS5] r.reclass

Folks,

Was anyone taking on the bug in r.reclass that produces an error when a
user enters floating-point category numbers? I have run into that problem
myself, so I wouldn't mind fixing it. Just scanning the code I can see
some readily fixable problems.

I don't want to go any further if someone else is already working on it.
Others certainly know more than I do about the inner workings of
reclassification, so before I go on I have a second question. Is it even
possible to reclassify a CELL raster map with FCELL or DCELL category
numbers, thus getting a reclass map that is a different type from the
original map?

Roger Miller
Lee Wilson and Associates

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Wed, May 16, 2001 at 04:31:47PM -0600, Roger S. Miller wrote:

Folks,

Was anyone taking on the bug in r.reclass that produces an error when a
user enters floating-point category numbers? I have run into that problem
myself, so I wouldn't mind fixing it. Just scanning the code I can see
some readily fixable problems.

I don't want to go any further if someone else is already working on it.
Others certainly know more than I do about the inner workings of
reclassification, so before I go on I have a second question. Is it even
possible to reclassify a CELL raster map with FCELL or DCELL category
numbers, thus getting a reclass map that is a different type from the
original map?

Roger, floating point handling should only go one way (i.e. on the input
side). It makes no sense to do a reclassification in floating point
numbers (i.e. the reclass is *not* continuous data). Just my 2¢.

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

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

"Eric G. Miller" wrote:

Roger, floating point handling should only go one way (i.e. on the input
side). It makes no sense to do a reclassification in floating point
numbers (i.e. the reclass is *not* continuous data). Just my 2¢.

You lost me there, Eric. Can you describe more what you mean or maybe
give me an example?

Roger Miller

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Wed, May 16, 2001 at 07:52:56PM -0600, Roger S. Miller wrote:

"Eric G. Miller" wrote:

> Roger, floating point handling should only go one way (i.e. on the input
> side). It makes no sense to do a reclassification in floating point
> numbers (i.e. the reclass is *not* continuous data). Just my 2¢.

You lost me there, Eric. Can you describe more what you mean or maybe
give me an example?

What I mean, is a reclassification is essentially categorical/interval. Can
you see why anyone would want to do a reclass of a floating point as another
floating point? Not to mention the weirdness of representing some
floating point numbers exactly... Anyway, I see these scenarios:

CELL -> CELL
FCELL -> CELL
DCELL -> CELL

If you want to allow all the possible mappings, go ahead. I'm just not
sure it makes any sense...

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

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

"Roger S. Miller" wrote:

Folks,

Was anyone taking on the bug in r.reclass that produces an error when a
user enters floating-point category numbers? I have run into that problem
myself, so I wouldn't mind fixing it. Just scanning the code I can see
some readily fixable problems.

I don't want to go any further if someone else is already working on it.
Others certainly know more than I do about the inner workings of
reclassification, so before I go on I have a second question. Is it even
possible to reclassify a CELL raster map with FCELL or DCELL category
numbers, thus getting a reclass map that is a different type from the
original map?

Roger Miller
Lee Wilson and Associates

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Roger,

The routines used in r.recode use the routines defined in the GIS lib in
the file fpreclass.c (libes/gis/fpreclass.c). These routines allow for
reclassification to and from all three raster types (CELL, FCELL, &
DCELL).

Rather than trying to fix r.reclass, it might be easier to make r.recode
accept the same classification rules as r.reclass.

Hope this helps.
--
Bob Covill

Tekmap Consulting
P.O. Box 2016 Fall River, N.S.
B2T 1K6
Canada

E-Mail: bcovill@tekmap.ns.ca
Phone: 902-860-1496
Fax: 902-860-1498

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Wed, May 16, 2001 at 09:54:38PM -0700, Eric G. Miller wrote:

On Wed, May 16, 2001 at 07:52:56PM -0600, Roger S. Miller wrote:
> "Eric G. Miller" wrote:
>
> > Roger, floating point handling should only go one way (i.e. on the input
> > side). It makes no sense to do a reclassification in floating point
> > numbers (i.e. the reclass is *not* continuous data). Just my 2¢.
>
> You lost me there, Eric. Can you describe more what you mean or maybe
> give me an example?

What I mean, is a reclassification is essentially categorical/interval. Can
you see why anyone would want to do a reclass of a floating point as another
floating point? Not to mention the weirdness of representing some
floating point numbers exactly... Anyway, I see these scenarios:

CELL -> CELL
FCELL -> CELL
DCELL -> CELL

If you want to allow all the possible mappings, go ahead. I'm just not
sure it makes any sense...

Roger,

perhaps r.recode provides what you need. It can replace
values in any type direction,

Markus

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Eric, Bob and Markus,

Eric wrote:

What I mean, is a reclassification is essentially categorical/interval. Can
you see why anyone would want to do a reclass of a floating point as another
floating point? Not to mention the weirdness of representing some
floating point numbers exactly... Anyway, I see these scenarios:

CELL -> CELL
FCELL -> CELL
DCELL -> CELL

I think in my ideal world most of the useful reclassifications would be

CELL -> CELL
CELL -> FCELL
CELL -> DCELL

That is, a basic map structure would be stored as a CELL map for small
size and speed of access and then the CELL map would be reclassified with
either different CELL values or with floating point data.

For instance, I have a CELL map in which each raster is categorized
according to its position in a ground water model finite-difference grid.
I prepare maps from that CELL map by reclassifying it with groundwater
levels calculated by the model.

If I'm just interested in illustrating the raw model results, then it
isn't a problem to convert the model results to integer values and
reclassify the original cell map as another cell map. If I want to use
the map for some other calculation -- change in water level over time, for
instance -- then the requirements are different. I need to reclassify the
map using floating point values. Calculations based on integer values
contain extraneous results caused by imprecision.

Creating a new raster map for each instance isn't a very good option. The
ground water model output doesn't include geographic data.
Reclassification allows me to use geographic data stored in the original
CELL map to provide a geographic intrepretation of the model results.
Otherwise I would have to reproduce the geographic data each time I wanted
to see a new set of model results. Also, each result would be produced as
a separate large raster file which -- even with compression -- is several
times larger than the reclass file.

As Bob and Markus suggest, r.recode might be an option. Correct me if I
misunderstand. Doesn't r.recode create a new raster map each time it's
invoked?

Last year we got the project files for a watershed analysis done at
Blacklands. The analysis was based on a large satellite image mosaic. I
think the base raster map alone (a GRASS 4 product) was about 14 megabytes
of data. The analysis included at least a dozen reclass maps based on the
original, but each of the reclass files was only a few thousands bytes.
If they were each a different raster map then the project would have been
impractical in my environment.

If my understanding of r.recode is right then there is still a real
need for r.reclass.

I spent some time last night studying the code underlying r.reclass. It
appears that none of the code has been brought up to GRASS 5 floating
point functionality. More importantly, the reclass file contains no
information on the raster type. Instead, that information must come from
the header of the raster file that is being reclassed. I haven't yet
imagined a way to allow type changes during reclassification without
storing type data in the reclass file and probably breaking existing
reclass maps. Without storing type data in the reclass file I think that
the only reclassifications possible are

CELL-> CELL
FCELL -> FCELL
DCELL -> DCELL

Does anyone see a way around that? If not, then the FCELL->FCELL and
DCELL->DCELL reclassification is still useful, just not as useful as it
could be.

Roger Miller
Lee Wilson and Associates

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

I was trying out the GUI a bit and if I choose Create New Location in the GRASS opening dialog, the program crashes (maybe). At least, it disappears.

Here is the message when the program seems to disappear:

Error opening terminal: xterm.

Any ideas?

Thanks,

Jeshua Lacock
Cartographer/Owner
http://SierraMaps.com
http://3dTopoMaps.com
Telephone: (760) 935-4481

---------------------------------------- If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Jeshua Lacock wrote:

I was trying out the GUI a bit and if I choose Create New Location in
the GRASS opening dialog, the program crashes (maybe). At least, it
disappears.

Here is the message when the program seems to disappear:

Error opening terminal: xterm.

Any ideas?

The curses library can't find the terminfo/termcap entry for "xterm".

This seems to be a common problem on MacOS X. I don't know what the
solution is. Andy Agena <andya@mac.com> was having exactly the same
problem. Andy: did you ever manage to solve it?

--
Glynn Clements <glynn.clements@virgin.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'