[GRASS5] r.in.png error?

Namnath, Sharyn NamnatSR at NV.DOE.GOV
Thu Sep 2 18:02:23 EDT 2004


Glynn,

I've been trying to look up how to use g.setproj, but I haven't figured it
out yet.  I am currently using Grass in php. I have created the PNG files,
and now want to access a chosen area PNG file so I can allow the user to
zoom in closer or pan the image. How does one use g.setproj to change the
location's projection to X/Y?  I tried it in the Grass terminal and it
appears to be interactive.

Thanks, 
- Sharyn namnath


> -----Original Message-----
> From: Glynn Clements [mailto:glynn.clements at virgin.net]
> Sent: Wednesday, September 01, 2004 4:25 PM
> To: David Piasecki
> Cc: grass5 at grass.itc.it
> Subject: Re: [GRASS5] r.in.png error?
> 
> 
> David Piasecki wrote:
> 
> > I used the PNG driver in GRASS to create a PNG image from my data. I
> > verified that the PNG image exists, and I can view it with any app
> > capable of reading the PNG format. I have not modified the region, and
> > I have verified that it is the same as when I originally created the
> > PNG file. However, when I attempt to import the PNG file using
> > r.in.png, I get the following error...
> >
> > 640 x 480 image, 8 bits palette+transparency // this is just extra
> > since I had the verbose option on
> > WARNING: G_set_window(): Illegal latitude for North
> > ERROR: Unable to set window
> >
> > Is there a way around this error?
> 
> This is a known issue with importing rasters into a lat/lon location.
> 
> Unless the raster has georeferencing information (and the importer can
> use it; AFAIK, this is currently only true of r.in.tiff and
> r.in.gdal), rasters are imported with the bottom-left corner at (0,0)
> and the top-right corner at (W,H), where W and H are the width and
> height of the raster.
> 
> In this case, r.in.png is trying to set the top-right corner of the
> region to (640,480), which isn't valid for a lat/lon location.
> 
> A workaround is to change the location's projection to X/Y with
> g.setproj, import the raster, set its boundaries with r.region, then
> change the location back to lat/lon.
> 
> Ultimately, someone needs to change the various r.in.* programs to
> handle this situation.
> 
> --
> Glynn Clements <glynn.clements at virgin.net>
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list