[GRASS-dev] Rendering from command line does not respect size

Vaclav Petras wenzeslaus at gmail.com
Sat May 2 15:04:52 PDT 2015


On Sat, May 2, 2015 at 12:13 PM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:
>
> On 01/05/15 05:24, Vaclav Petras wrote:
>>
>> Hi,
>>
>> I was trying to render some maps automatically but I'm having problems
>> with setting the size of the image. I set size like this:
>>
>> [...]

Again for cairo:

$ mkdir abc1
$ cd abc1
$ export GRASS_RENDER_HEIGHT=1350
$ export GRASS_RENDER_WIDTH=1500
$ g.region raster=elevation
$ d.mon cairo
Output file: .../abc1/map.png
$ d.rast elevation
$ file map.png
map.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced
(image contains elevation in 640 x 480)

The same for SVG:

<svg ... width="640pt" height="480pt" viewBox="0 0 640 480" version="1.1">
...
<image id="image5" width="640" height="480"...

and also PDF.

And again for png:

$ mkdir abc2
$ cd abc2
$ export GRASS_RENDER_HEIGHT=1350
$ export GRASS_RENDER_WIDTH=1500
$ g.region raster=elevation
$ d.mon png
Output file: .../abc2/map.png
$ d.rast elevation
ERROR: PNG: input file has incorrect dimensions: expected: 640x480 got:
       1500x1350
$ file map.png
map.png: PNG image data, 1500 x 1350, 8-bit/color RGBA, non-interlaced
(image contains nothing but has 1500 x 1350)

>
> I have a vague memory that such an error occurs when you have an existing
map.png file in the current directory with dimensions different from the
ones you set.

I've tried to use an empty directory but no effect. So this is not the
case. According to this test it seems that PNG driver does not work at all
with different height and width, is that even possible?

Vaclav

>
> Moritz
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150502/8178c9bd/attachment.html>


More information about the grass-dev mailing list