[GRASS5] r.in.gdal and GCPs

Markus,

I have committed a change to r.in.gdal to support GCPs. If GCPs are
detected an imagery group will be made, even if normally only a raster
would have been created, and the GCPs are written out to a POINTS file.
The user will still have to pick an appropriate location and mapset to
rectify to with i.target, and use i.rectify to take advantage of the
GCPs.

I also realized that I can't translate signed integers to FTYPE_CELL
because it is unsigned. That means that complex integer bands must be
converted to floating point layers as occurs now, contrary to the
change I tried this morning.

I have tried the altered r.in.gdal with ERS2 CEOS and other datasets and
they seem to work OK, though I found it challenging to visualize the
resulting images. How does one normally display floating point data in
a monitor? I even tried converting the complex images to magnitude and
scaling with r.mapcalc, but somehow I wasn't doing it right. Also, how
do I get information on the min, max, and mean of a raster? I tried
r.info, r.describe, and r.stats but couldn't seem to find what I would
wanting.

Best regards,

--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent

Frank:

On Wed, 5 Sep 2001, Frank Warmerdam wrote:

scaling with r.mapcalc, but somehow I wasn't doing it right. Also, how
do I get information on the min, max, and mean of a raster? I tried
r.info, r.describe, and r.stats but couldn't seem to find what I would
wanting.

Maybe r.statistics, but it seems to be broken (the handshake to r.stats
seems to have the wrong option flags). Of course it's overkill, but with
the R interface, it's:

GRASS:~ > R

library(GRASS)
summary(rast.get(gmeta(), "topo")[[1]])

   Min. 1st Qu. Median Mean 3rd Qu. Max.
   40.0 62.0 100.0 115.3 167.0 278.0

for the leics topo layer.

Would a small collection of shell scripts to use R for things like this be
any use (R can be run as a back-end)? (I've already written s.kcv
look-alike as an R function).

Roger

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.

Frank,

On Wed, Sep 05, 2001 at 10:19:39PM -0400, Frank Warmerdam wrote:

Markus,

I have committed a change to r.in.gdal to support GCPs. If GCPs are
detected an imagery group will be made, even if normally only a raster
would have been created, and the GCPs are written out to a POINTS file.
The user will still have to pick an appropriate location and mapset to
rectify to with i.target, and use i.rectify to take advantage of the
GCPs.

great work - I will try this later the day. This is really a help.

I also realized that I can't translate signed integers to FTYPE_CELL
because it is unsigned. That means that complex integer bands must be
converted to floating point layers as occurs now, contrary to the
change I tried this morning.

I see. Anyway, it's no bug.

I have tried the altered r.in.gdal with ERS2 CEOS and other datasets and
they seem to work OK, though I found it challenging to visualize the
resulting images. How does one normally display floating point data in
a monitor? I even tried converting the complex images to magnitude and
scaling with r.mapcalc, but somehow I wasn't doing it right.

I have done it like this:
# SLC: intensity image

r.mapcalc sar.intensity="sqrt((sar.real*sar.real) + (sar.imaginary*sar.imaginary))"

Then, important, change the color table with r.colors. What do you (not)
see?

Also, how
do I get information on the min, max, and mean of a raster? I tried
r.info, r.describe, and r.stats but couldn't seem to find what I would
wanting.

You can look at r.colors (main.c), it is checking for the range (there is a
GRASS function to get the mean).

Later,

Markus

On Wed, Sep 05, 2001 at 10:19:39PM -0400, Frank Warmerdam wrote:
[...]

Also, how
do I get information on the min, max, and mean of a raster? I tried
r.info, r.describe, and r.stats but couldn't seem to find what I would
wanting.

An update here:

on module level there is only the script
r.univar
providing these information. Unfortunately pretty slow as
being shell/awk based.

Maybe r.stats and code from s.univar (C) should be merged to
a new r.univar?

Markus

On Wed, Sep 05, 2001 at 10:19:39PM -0400, Frank Warmerdam wrote:
[...]

Also, how
do I get information on the min, max, and mean of a raster? I tried
r.info, r.describe, and r.stats but couldn't seem to find what I would
wanting.

Hi Frank, hi all,

I have added range output to r.info.

Best regards

Markus