Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-24 Thread Hamish
Paolo wrote:
  Sorry I was unclear: importing the map results in an automatically
  nicely coloured map, whereas r.external results in a greyscale.

Markus N wrote:
 Probably r.external is presetting instead a grey-scale color
 table?

yes, it is doing that, see main.c line ~ 340.

if gdal supplies a color table it uses it, otherwise r.external checks
if the map is type GDT_Byte and if so applies the grey255 rules. Or, if
some other data type applies G_make_grey_scale_colors() based on the
range. I would suggest that this be changed to not create any color table
if none is provided. (and so act like other grass modules do in that
case and fall back to rainbow rules)


Hamish
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-24 Thread Markus Neteler
On Fri, Feb 24, 2012 at 9:24 AM, Hamish hamis...@yahoo.com wrote:
 Paolo wrote:
  Sorry I was unclear: importing the map results in an automatically
  nicely coloured map, whereas r.external results in a greyscale.

 Markus N wrote:
 Probably r.external is presetting instead a grey-scale color
 table?

 yes, it is doing that, see main.c line ~ 340.

 if gdal supplies a color table it uses it, otherwise r.external checks
 if the map is type GDT_Byte and if so applies the grey255 rules. Or, if
 some other data type applies G_make_grey_scale_colors() based on the
 range. I would suggest that this be changed to not create any color table
 if none is provided. (and so act like other grass modules do in that
 case and fall back to rainbow rules)

+1 (then it becomes again the least surprise approach)

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-24 Thread Paolo Cavallini

Il 24/02/2012 09:24, Hamish ha scritto:

yes, it is doing that, see main.c line ~ 340.

if gdal supplies a color table it uses it, otherwise r.external checks
if the map is type GDT_Byte and if so applies the grey255 rules. Or, if
some other data type applies G_make_grey_scale_colors() based on the
range. I would suggest that this be changed to not create any color table
if none is provided. (and so act like other grass modules do in that
case and fall back to rainbow rules)

ok, thanks a lot for clarifying.
all the best.

--
Paolo Cavallini
See: http://www.faunalia.it/pc

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-24 Thread Glynn Clements

Hamish wrote:

 if gdal supplies a color table it uses it, otherwise r.external checks
 if the map is type GDT_Byte and if so applies the grey255 rules. Or, if
 some other data type applies G_make_grey_scale_colors() based on the
 range. I would suggest that this be changed to not create any color table
 if none is provided. (and so act like other grass modules do in that
 case and fall back to rainbow rules)

Note that r.in.gdal behaves similarly: if the input file lacks a
colour table, it creates a 0..255 grey-scale table for GDT_Byte, and a
range-based grey-scale table for GDT_UInt16.

It may be desirable to keep the two consistent. OTOH, r.in.gdal has a
longer history than r.external (i.e. it's more likely that someone is
relying upon the existing behaviour of r.in.gdal than is the case for
r.external).

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Paolo Cavallini

Hi all.
Importing a dtm raster assign a correct colour table to it.
If I load it with r.external, instead, only a greyscale is applied. This 
happens through the qgis plugin, do not know if it's the same with other 
interfaces).

Is this a known issue?
All the best.

--
Paolo Cavallini
See: http://www.faunalia.it/pc

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Markus Neteler
On Thu, Feb 23, 2012 at 12:03 PM, Paolo Cavallini cavall...@faunalia.it wrote:
 Hi all.
 Importing a dtm raster assign a correct colour table to it.

Which format do you have? For example, GeoTIFF has only limited color table
support.

 If I load it with r.external, instead, only a greyscale is applied. This
 happens through the qgis plugin, do not know if it's the same with other
 interfaces).

Which operating system and which GRASS version?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Paolo Cavallini

Il 23/02/2012 14:04, Markus Neteler ha scritto:

On Thu, Feb 23, 2012 at 12:03 PM, Paolo Cavallinicavall...@faunalia.it  wrote:

Hi all.
Importing a dtm raster assign a correct colour table to it.

Which format do you have? For example, GeoTIFF has only limited color table
support.

adf (the same raster when imported has its nice colormap).

Which operating system and which GRASS version?

Debian testing, official package: 6.4.1-2
Thanks.

--
Paolo Cavallini
See: http://www.faunalia.it/pc

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Markus Neteler
On Thu, Feb 23, 2012 at 12:03 PM, Paolo Cavallini cavall...@faunalia.it wrote:
 Hi all.
 Importing a dtm raster assign a correct colour table to it.
 If I load it with r.external, instead, only a greyscale is applied.

Do you use r.colors?

This happens through the qgis plugin, do not know if it's the same with other
 interfaces).
 Is this a known issue?

I tried in GRASS:

# quick and dirty test:
GRASS 6.4.3svn (latlong_wgs84):~/data/maps/fao_forest_fra2000/frst_gez
 r.external /home/neteler/data/maps/fao_forest_fra2000/frst_gez/w001001.adf
out=test
WARNING: Datum Not_specified_based_on_Clarke_1866_ellipsoid not
 recognised by GRASS and no parameters found
Projection of input dataset and current location appear to match
Importing band 1 of 1...
Link to raster map test created

GRASS 6.4.3svn (latlong_wgs84):~/  g.region rast=test -p
projection: 3 (Latitude-Longitude)
zone:   0
datum:  wgs84
ellipsoid:  wgs84
north:  90N
south:  90S
west:   180W
east:   180E
nsres:  0:00:32.4
ewres:  0:00:32.4
rows:   2
cols:   4
cells:  8

GRASS 6.4.3svn (latlong_wgs84):~/  r.colors test col=gyr
Color table for raster map test set to 'gyr'

GRASS 6.4.3svn (latlong_wgs84):~/  d.mon x0
GRASS 6.4.3svn (latlong_wgs84):~/ d.rast test

The map is nicely colorized.
I did not try in QGIS.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Paolo Cavallini

Il 23/02/2012 14:57, Markus Neteler ha scritto:

On Thu, Feb 23, 2012 at 12:03 PM, Paolo Cavallinicavall...@faunalia.it  wrote:

Hi all.
Importing a dtm raster assign a correct colour table to it.
If I load it with r.external, instead, only a greyscale is applied.

Do you use r.colors?


This happens through the qgis plugin, do not know if it's the same with other
interfaces).
Is this a known issue?

I tried in GRASS:

# quick and dirty test:
GRASS 6.4.3svn (latlong_wgs84):~/data/maps/fao_forest_fra2000/frst_gez
Sorry I was unclear: importing the map results in an automatically 
nicely coloured map, whereas r.external results in a greyscale. 
Apparently r.in.gdal applies automatically an appropriated colour map, 
r.external does not.

All the best.

--
Paolo Cavallini
See: http://www.faunalia.it/pc

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] rasters loaded with r.external miss a colour table?

2012-02-23 Thread Markus Neteler
On Fri, Feb 24, 2012 at 7:15 AM, Paolo Cavallini cavall...@faunalia.it wrote:
 Sorry I was unclear: importing the map results in an automatically nicely
 coloured map, whereas r.external results in a greyscale.

Ah, this is a different issue then.

 Apparently r.in.gdal applies automatically an appropriated colour map, 
 r.external does
 not.

GRASS, in case that no color table is present, applies the rainbow color table.
Probably r.external is presetting instead a grey-scale color table?

In any case quickly solvable with r.colors to apply one of the nice predefined
color tables.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user