[GRASS-user] Creating a png file with multiple vector maps

Chris Bartolomei surfcjb at yahoo.com
Mon Mar 22 16:15:33 PDT 2021


 Thanks Nikos! I'll try that way too:)
Chris
    On Monday, March 22, 2021, 5:23:11 AM EDT, <nik at nikosalexandris.net> wrote:  
 
 For what is worth,

I have asked for help or commented maybe on this or similar subjects in 
the past.
It is for years now that the PNG driver does not work for vector maps 
(for me)
from the command line.  I have tried various terminals but I still have 
no clear idea what the problem is.  The only way I manage to render 
vector maps (even multiple ones, rendering on the same file) is using 
the BMP file format.

Here are my 'GRASS GIS display driver' related settings:

https://gitlab.com/NikosAlexandris/tygrass/-/blob/6a0e13310c4a7a086dc74ee6c61c2fa467881a85/.grass.render

(BMP set here for vector maps: 
https://gitlab.com/NikosAlexandris/tygrass/-/blob/6a0e13310c4a7a086dc74ee6c61c2fa467881a85/.grass.render#L22).


My custom functions to render vector maps are `tyvector` and 
`tyvector.add` defined in:

https://gitlab.com/NikosAlexandris/tygrass/-/blob/6a0e13310c4a7a086dc74ee6c61c2fa467881a85/.grass.tygrass.vector

If you take out the `tycat` part that prints an image in the terminal, 
then the rest of the steps render a vector map in a new file or render 
on top of an existing file.


Various helper functions to (re-)set display driver parameters here:

https://gitlab.com/NikosAlexandris/tygrass/-/blob/6a0e13310c4a7a086dc74ee6c61c2fa467881a85/.grass.tygrass.helpers


Maybe this is useful, Nikos
---


On 2021-03-22 00:30, Chris Bartolomei via grass-user wrote:

> Thanks Helmut - that's exactly what I'm looking for. It's really 
> strange that it isn't working on our cluster but I'm back in the office 
> tomorrow so I'll try it again, carefully copying the variables as you 
> have them set.
> Thanks again for all the support you give everyone!
> :)
> Chris
> 
> On Sunday, March 21, 2021, 3:40:51 PM EDT, Helmut Kudrnovsky 
> <hellik at web.de> wrote:
> 
>> Helmut ... thank you for your example however I think there is a 
>> misunderstanding of what I am trying to do.
>> I am using >GRASS on Linux (on a cluster) and the issue I am 
>> experiencing is overlaying two polygon maps (layers in Arc-speak).
>> Points and lines on top of ONE set of polygons works fine as you have 
>> shown, however using two or more polygon maps
>> (layers) does not seem to work. I attached an example of what i am 
>> trying to achieve: Take for instance a polygon
>> representing Italy and you wanted it colored dark gray, then you want 
>> to overlay on top of that an administrative map
>> showing only the areas of Lazio and Liguria colored in blue but no 
>> other administrative areas. The result would look
>> like the Italy_sample.png file i attached (I made is using ArcPro as i 
>> am not in the office with access to our cluster).
>> This is what is not working using the d.mon=png, d.vect tools. Could 
>> you please try something similar and see if it works for you (on 
>> linux)?
> 
> I'm not on linux, though I think it works there too.
> 
> testing here in with winGRASS 7.8.5 and overlaping vector polygon 
> layers by following commands:
> 
> ---------------
> 
> REM start of the batch file
> 
> set GRASS_RENDER_IMMEDIATE=png
> set GRASS_RENDER_WIDTH=640
> set GRASS_RENDER_HEIGHT=480
> set GRASS_RENDER_TRANSPARENT=true
> set GRASS_RENDER_TRUECOLOR=true
> set GRASS_RENDER_FILE_COMPRESSION=9
> set GRASS_MESSAGE_FORMAT=plain
> set GRASS_RENDER_FILE_READ=TRUE
> 
> g.region vector=x006441899_100_VGD_AT at data
> 
> d.vect map=x006441899_100_VGD_AT at data fill_color=192:192:192:255 
> width=1
> d.vect map=x006441899_100_VGD_BL at data color=0:0:0:255 
> fill_color=128:255:0:255 width=1
> d.vect map=x006441899_100_VGD_PG at data color=255:0:0:255 
> fill_color=0:0:255:255 width=2
> 
> REM end of the batch file
> 
> ---------------
> 
> see attached file, overlaying several polygones works here.
> 
> maybe others can test it on linux.
> 
> kind regards
> Helmut
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210322/9672d29e/attachment.html>


More information about the grass-user mailing list