[GRASS5] using r.in.gdal on png provides negative south/west

When importing the attached png into a 50x50 xy-Location, the region settings become negative. With former r.in.png, they were positive. *confused*

/Stefan

GRASS 6.0.cvs:~ > g.region -p
projection: 0 (x,y)
zone: 0
north: 50
south: 0
west: 0
east: 50
nsres: 1
ewres: 1
rows: 50
cols: 50

GRASS 6.0.cvs:~ > r.in.gdal input=/smilegrass.png output=smile

Projection of input dataset and current location appear to match.
Proceeding with import...
100%
CREATING SUPPORT FILES FOR smile.red
SETTING GREY COLOR TABLE FOR smile.red (8bit, full range)
100%
CREATING SUPPORT FILES FOR smile.green
SETTING GREY COLOR TABLE FOR smile.green (8bit, full range)
100%
CREATING SUPPORT FILES FOR smile.blue
SETTING GREY COLOR TABLE FOR smile.blue (8bit, full range)
100%
CREATING SUPPORT FILES FOR smile.alpha
SETTING GREY COLOR TABLE FOR smile.alpha (8bit, full range)

GRASS 6.0.cvs:~ > g.region rast=smile.green

GRASS 6.0.cvs:~ > g.region -p
projection: 0 (x,y)
zone: 0
north: 0
south: -36
west: -49
east: 0
nsres: 1
ewres: 1
rows: 36
cols: 49
GRASS 6.0.cvs:~ >

/*** EOT ***/

(attachments)

smilegrass.png

On Fri, Jan 21, 2005 at 03:23:48AM +0100, Stefan Paulick wrote:

When importing the attached png into a 50x50 xy-Location, the region
settings become negative. With former r.in.png, they were positive.
*confused*

Here is what the source code says:

raster/r.in.gdal/main.c
/*
* r.in.gdal imports many GIS/image formats into GRASS utilizing the GDAL
* library
*
* copyright of this file
* Author: Frank Warmerdam
*
* Added optional GCP transformation: Markus Neteler 10/2001
* TODO: most unreferenced formats are read in with negative coordinates - desired??
*/

See the last line... open for discussion.

Markus

That's one of the shoals driving unexperienced users into deepest depression - displaying the imported stuff does show a blank screen which may mislead to the opinion that the import failed: wrong image format, gdal not working, dunno whatever!

Frank: Is it a man's task to get positive readings?

If yes, I would love to see some kind of information/warning out of r..in.gdal; maybe combined with a hint how to solve. it. Should do, even for me...:_))

/Stefan

Markus Neteler schrieb:

On Fri, Jan 21, 2005 at 03:23:48AM +0100, Stefan Paulick wrote:

When importing the attached png into a 50x50 xy-Location, the region settings become negative. With former r.in.png, they were positive. *confused*

Here is what the source code says:

raster/r.in.gdal/main.c
/*
* r.in.gdal imports many GIS/image formats into GRASS utilizing the GDAL
* library
*
* copyright of this file
* Author: Frank Warmerdam
*
* Added optional GCP transformation: Markus Neteler 10/2001
* TODO: most unreferenced formats are read in with negative coordinates - desired??
*/

See the last line... open for discussion.

Markus

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

That's one of the shoals driving unexperienced users into deepest
depression - displaying the imported stuff does show a blank screen
which may mislead to the opinion that the import failed: wrong image
format, gdal not working, dunno whatever!

Regardless of this "feature", all tutorials should really be mentioning
the use of 'g.region raster=newmap' before displaying a new map ...

Hamish

Hamish wrote:

> That's one of the shoals driving unexperienced users into deepest
> depression - displaying the imported stuff does show a blank screen
> which may mislead to the opinion that the import failed: wrong image
> format, gdal not working, dunno whatever!

Regardless of this "feature", all tutorials should really be mentioning
the use of 'g.region raster=newmap' before displaying a new map ...

It's more likely that they should be mentioning the use of r.region to
set the map's boundaries.

A blank screen is usually caused by the map being in the wrong place,
not the region.

--
Glynn Clements <glynn@gclements.plus.com>

Glynn Clements writes:
> Hamish wrote:
>
> > > That's one of the shoals driving unexperienced users into deepest
> > > depression - displaying the imported stuff does show a blank screen
> > > which may mislead to the opinion that the import failed: wrong image
> > > format, gdal not working, dunno whatever!
> >
> > Regardless of this "feature", all tutorials should really be mentioning
> > the use of 'g.region raster=newmap' before displaying a new map ...
>
> It's more likely that they should be mentioning the use of r.region to
> set the map's boundaries.

Even better: r.in.gal should set the region unless you specify the
-nr option.

--
--My blog is at angry-economist.russnelson.com | Freedom means allowing
Crynwr sells support for free software | PGPok | people to do things the
521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are
Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs.

On Mon, Jan 24, 2005 at 11:56:53AM +1300, Hamish wrote:

> That's one of the shoals driving unexperienced users into deepest
> depression - displaying the imported stuff does show a blank screen
> which may mislead to the opinion that the import failed: wrong image
> format, gdal not working, dunno whatever!

Regardless of this "feature", all tutorials should really be mentioning
the use of 'g.region raster=newmap' before displaying a new map ...

(the new GRASS book does)

Suggestion: d.vect tell us if all vectors are outside the
current region. Can't we do the same at least for the raster
bounding box?

Markus