[GRASS-user] GRASS GIS through PyWPS bridge

Vaclav Petras wenzeslaus at gmail.com
Fri Dec 6 07:15:37 PST 2013


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
[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 <nitendra.gautam at my.ndsu.edu
> 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
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20131206/d6763a59/attachment-0001.html>


More information about the grass-user mailing list