[GRASS-user] exporting map display

Hello,

is there a way to invoke d.out.file in order to export the current wx
map display ? I would like to be able to generate a georeferenced view
on the fly, i.e. a map composition containing vector overlay with
transparency over a raster background. The button "save display to
graphic file" does not offer the geotiff option provided by d.out.file.
I could reproduce the map composition in a x monitor but it does not
support transparency...

Thanks for your advice,
Vincent

On Sep 9, 2015 3:13 AM, “Vincent Bain” <bain@toraval.fr> wrote:

Hello,

is there a way to invoke d.out.file in order to export the current wx
map display ? I would like to be able to generate a georeferenced view
on the fly, i.e. a map composition containing vector overlay with
transparency over a raster background. The button “save display to
graphic file” does not offer the geotiff option provided by d.out.file.
I could reproduce the map composition in a x monitor but it does not
support transparency…

Try d.to.rast, it creates a georeferenced raster map in the current mapset.

Anna

Thanks for your advice,
Vincent


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

Thanks you Anna,

unfortunately I understand d.to.rast cannot handle the content of the
gui default display frame, which is the only display that allows me to
tweak transparency.

My temporary fix was to :
-"set computational region from display extent" ;
-press the button "save display to graphic file", outputting my
composition in a source.png file ;
-then write down a short shell script in this flavor :

%------------
eval `g.region -g`
IFS=,
size=($(identify -format %w,%h source.png))
gdal_translate -gcp 0 0 $w $n -gcp ${size[0]} 0 $e $n -gcp ${size[0]}
${size[1]} $e $s source.png target.tif
gcps2wld.py target.tif>target.tfw
%------------

This method is certainly not much accurate but it provides me a fast
georeferenced snapshot of a map composition.

Yours,
Vincent

Hi Vincent,

if I understand your use case correctly, d.to.rast should do what you want. It works in GUI. But maybe I am misunderstanding.

···

On Wed, Sep 9, 2015 at 9:52 AM, Vincent Bain <bain@toraval.fr> wrote:

Thanks you Anna,

unfortunately I understand d.to.rast cannot handle the content of the
gui default display frame, which is the only display that allows me to
tweak transparency.

My temporary fix was to :
-“set computational region from display extent” ;
-press the button “save display to graphic file”, outputting my
composition in a source.png file ;
-then write down a short shell script in this flavor :

%------------
eval g.region -g
IFS=,
size=($(identify -format %w,%h source.png))
gdal_translate -gcp 0 0 $w $n -gcp ${size[0]} 0 $e $n -gcp ${size[0]}
${size[1]} $e $s source.png target.tif
gcps2wld.py target.tif>target.tfw
%------------

This method is certainly not much accurate but it provides me a fast
georeferenced snapshot of a map composition.

Yours,
Vincent

I might miss something : when I run the command I get this error :
ERROR: No graphics device selected. Use d.mon to select graphics device.

Is it necessary to first start a graphics monitor (which one ?) and how
is it possible to populate this display via the GUI layer manager (and
not commands like d.vect, d.rast...)

Sorry, I guess my issue is stupid!
Vincent.

Le mercredi 09 septembre 2015 à 12:27 -0400, Anna Petrášová a écrit :

Hi Vincent,

if I understand your use case correctly, d.to.rast should do what you
want. It works in GUI. But maybe I am misunderstanding.

On Wed, Sep 9, 2015 at 9:52 AM, Vincent Bain <bain@toraval.fr> wrote:
        Thanks you Anna,
        
        unfortunately I understand d.to.rast cannot handle the content
        of the
        gui default display frame, which is the only display that
        allows me to
        tweak transparency.
        
        My temporary fix was to :
        -"set computational region from display extent" ;
        -press the button "save display to graphic file", outputting
        my
        composition in a source.png file ;
        -then write down a short shell script in this flavor :
        
        %------------
        eval `g.region -g`
        IFS=,
        size=($(identify -format %w,%h source.png))
        gdal_translate -gcp 0 0 $w $n -gcp ${size[0]} 0 $e $n -gcp
        ${size[0]}
        ${size[1]} $e $s source.png target.tif
        gcps2wld.py target.tif>target.tfw
        %------------
        
        This method is certainly not much accurate but it provides me
        a fast
        georeferenced snapshot of a map composition.
        
        Yours,
        Vincent
        

On Wed, Sep 9, 2015 at 12:43 PM, Vincent Bain <bain@toraval.fr> wrote:

I might miss something : when I run the command I get this error :
ERROR: No graphics device selected. Use d.mon to select graphics device.

hm, in trunk, I am getting some weird error, but in releasebranch, typing
in GUI command console :

d.to.rast output=xxx

works for me. I have to look at the error.

Is it necessary to first start a graphics monitor (which one ?) and how
is it possible to populate this display via the GUI layer manager (and
not commands like d.vect, d.rast...)

Sorry, I guess my issue is stupid!
Vincent.

Le mercredi 09 septembre 2015 à 12:27 -0400, Anna Petrášová a écrit :
> Hi Vincent,
>
>
> if I understand your use case correctly, d.to.rast should do what you
> want. It works in GUI. But maybe I am misunderstanding.
>
> On Wed, Sep 9, 2015 at 9:52 AM, Vincent Bain <bain@toraval.fr> wrote:
> Thanks you Anna,
>
> unfortunately I understand d.to.rast cannot handle the content
> of the
> gui default display frame, which is the only display that
> allows me to
> tweak transparency.
>
> My temporary fix was to :
> -"set computational region from display extent" ;
> -press the button "save display to graphic file", outputting
> my
> composition in a source.png file ;
> -then write down a short shell script in this flavor :
>
> %------------
> eval `g.region -g`
> IFS=,
> size=($(identify -format %w,%h source.png))
> gdal_translate -gcp 0 0 $w $n -gcp ${size[0]} 0 $e $n -gcp
> ${size[0]}
> ${size[1]} $e $s source.png target.tif
> gcps2wld.py target.tif>target.tfw
> %------------
>
> This method is certainly not much accurate but it provides me
> a fast
> georeferenced snapshot of a map composition.
>
>
>
> Yours,
> Vincent
>
>
>