Thank You Vaclav Peters for your reply.

Well i am trying to use GRASS GISas a back end server for web processing 
service.

I did  modified my code according to your suggestions but did some mistake on 
the say

i have pasted my code here(http://pastie.org/8533927).


I think i did some mistake on passing the argument in the function .you can 
check on link 2 on http://134.129.125.124/.

I am getting the following error message in my error log.


 Premature end of script headers: newcode2.py, referer: http://134.129.125.124/

Any suggestions on where i did wrong?


Thank You

Nitendra Gautam

________________________________
From: Vaclav Petras <[email protected]>
Sent: Friday, December 06, 2013 9:15 AM
To: Nitendra Gautam
Cc: [email protected]
Subject: Re: [GRASS-user] GRASS GIS through PyWPS bridge

Hi Nitendra,

your code says



"r.out.png","input=the/tiff/file","out=/the/png/file"

But r.out.png [1] is not converter between image formats (this is what 
ImageMagic does [2]). If the images are georeferenced then GDAL [3] is the 
right option for file format conversion. r.out.png exports GRASS raster map, so 
input should be GRASS raster map not a tiff file.

If you want to use GRASS for this conversion (e.g. this conversion is only 
example process and in fact you want to do some serious processing in GRASS), 
you need to import the tiff file first or link it as external map. For import 
to GRASS use r.in.gdal [4]. For linking the tiff file as external map use 
r.external [5].

Note that if the tiff has colors it will be splitted into three maps and if you 
want to show it as one RGB map, you need to use r.composite [6].

Than you can do what ever processing you want and then export the result as PNG 
using r.out.png.

Hope that helps,
Vaclav

[1] http://grass.osgeo.org/grass70/manuals/r.out.png.html
[2] http://www.imagemagick.org<http://www.imagemagick.org/>
[3] http://www.gdal.org/
[4] http://grass.osgeo.org/grass70/manuals/r.in.gdal.html
[5] http://grass.osgeo.org/grass70/manuals/r.external.html
[6] http://grass.osgeo.org/grass70/manuals/r.composite.html


On Wed, Dec 4, 2013 at 3:19 PM, Nitendra Gautam 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I want to make a simple web page that uses web processing capabilities of GRASS 
as  a back end and displays image on the webpage.I am using CGI interface of 
python and PyWPS bridge connecting them .
right now my web page(http://134.129.125.124/)  displays a normal JPG image by 
from <JPG image button>.
I want to write a  simple python script which uses Grass GIS to convert a TIFF 
image to png or other formats.This script should run as a back end.
I have pasted my script (http://pastie.org/8529097).But its not working right 
now.

Can you please give me suggestions ?

Thank You
Nitendra





_______________________________________________
grass-user mailing list
[email protected]<mailto:[email protected]>
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to