d.vect output a black PNG

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

d.vect output a black PNG

Carlos Henrique Grohmann de Carvalho-2
Hello all

Continuing my process of making a series of maps for a paper using python loops and d.mon with PNG outputs, now d.vect is giving me a hard time.

using a loop like this one:

    for dem in dems:
        out_shade = dem + area + '_shade_315_20'
        vect_contour = dem + area + '_contours_zoom'
        grass.run_command('g.region',n=n,s=s,w=w,e=e, flags='pa')
        grass.run_command('d.mon', start='png', output=dem+area+'_shade_contours.png', \
            resolution='3', height=500, width=500, overwrite=True)
        grass.run_command('d.rast', map=out_shade)
        grass.run_command('d.vect', map=vect_contour, type='line')
        grass.run_command('d.grid', size='0.025', text_color='black', fontsize=16, flags='c')
        grass.run_command('d.mon', stop='png')

I get maps that are ok, some that are partially blacked out and some that are completely black!

Any hints on this? The area in the images below is quite small, and the contour lines were calculated only in this small region, to keep the filesize small.


I tried this on MacOS (homebrew and Michael's new binary) and on Linux, with the same results.


many thanks

Carlos






Inline image 1Inline image 2Inline image 4Inline image 5Inline image 3


--
Prof. Carlos Henrique Grohmann
Institute of Energy and Environment - Univ. of São Paulo, Brazil
- Digital Terrain Analysis | GIS | Remote Sensing - 

http://orcid.org/0000-0001-5073-5572
________________
Can’t stop the signal.

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: d.vect output a black PNG

Anna Petrášová
Have you tried cairo driver? I feel like I've seen something like this before with PNG driver.

Anna

On Thu, Jan 18, 2018 at 5:46 PM, Carlos Grohmann <[hidden email]> wrote:
Hello all

Continuing my process of making a series of maps for a paper using python loops and d.mon with PNG outputs, now d.vect is giving me a hard time.

using a loop like this one:

    for dem in dems:
        out_shade = dem + area + '_shade_315_20'
        vect_contour = dem + area + '_contours_zoom'
        grass.run_command('g.region',n=n,s=s,w=w,e=e, flags='pa')
        grass.run_command('d.mon', start='png', output=dem+area+'_shade_contours.png', \
            resolution='3', height=500, width=500, overwrite=True)
        grass.run_command('d.rast', map=out_shade)
        grass.run_command('d.vect', map=vect_contour, type='line')
        grass.run_command('d.grid', size='0.025', text_color='black', fontsize=16, flags='c')
        grass.run_command('d.mon', stop='png')

I get maps that are ok, some that are partially blacked out and some that are completely black!

Any hints on this? The area in the images below is quite small, and the contour lines were calculated only in this small region, to keep the filesize small.


I tried this on MacOS (homebrew and Michael's new binary) and on Linux, with the same results.


many thanks

Carlos






Inline image 1Inline image 2Inline image 4Inline image 5Inline image 3


--
Prof. Carlos Henrique Grohmann
Institute of Energy and Environment - Univ. of São Paulo, Brazil
- Digital Terrain Analysis | GIS | Remote Sensing - 

http://orcid.org/0000-0001-5073-5572
________________
Can’t stop the signal.

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


_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: d.vect output a black PNG

Carlos Henrique Grohmann de Carvalho-2
It works! Thanks for the tip Anna!

Carlos

On Thu, Jan 18, 2018 at 9:59 PM, Anna Petrášová <[hidden email]> wrote:
Have you tried cairo driver? I feel like I've seen something like this before with PNG driver.

Anna

On Thu, Jan 18, 2018 at 5:46 PM, Carlos Grohmann <[hidden email]> wrote:
Hello all

Continuing my process of making a series of maps for a paper using python loops and d.mon with PNG outputs, now d.vect is giving me a hard time.

using a loop like this one:

    for dem in dems:
        out_shade = dem + area + '_shade_315_20'
        vect_contour = dem + area + '_contours_zoom'
        grass.run_command('g.region',n=n,s=s,w=w,e=e, flags='pa')
        grass.run_command('d.mon', start='png', output=dem+area+'_shade_contours.png', \
            resolution='3', height=500, width=500, overwrite=True)
        grass.run_command('d.rast', map=out_shade)
        grass.run_command('d.vect', map=vect_contour, type='line')
        grass.run_command('d.grid', size='0.025', text_color='black', fontsize=16, flags='c')
        grass.run_command('d.mon', stop='png')

I get maps that are ok, some that are partially blacked out and some that are completely black!

Any hints on this? The area in the images below is quite small, and the contour lines were calculated only in this small region, to keep the filesize small.


I tried this on MacOS (homebrew and Michael's new binary) and on Linux, with the same results.


many thanks

Carlos






Inline image 1Inline image 2Inline image 4Inline image 5Inline image 3


--
Prof. Carlos Henrique Grohmann
Institute of Energy and Environment - Univ. of São Paulo, Brazil
- Digital Terrain Analysis | GIS | Remote Sensing - 

http://orcid.org/0000-0001-5073-5572
________________
Can’t stop the signal.

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




--
Prof. Carlos Henrique Grohmann
Institute of Energy and Environment - Univ. of São Paulo, Brazil
- Digital Terrain Analysis | GIS | Remote Sensing - 

http://orcid.org/0000-0001-5073-5572
________________
Can’t stop the signal.

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