Greetings
I'm trying to run d.out.file to produce a PNG file with a defined size (and others) but I get the following error:
ERROR: You must select a display monitor.
SInce I'm running from WxPython interface how can I do that?
THanks
Antonio
__________ Information from ESET NOD32 Antivirus, version of virus signature database 6633 (20111115) __________
I'm trying to run d.out.file to produce a PNG file with a defined size (and
others) but I get the following error:
ERROR: You must select a display monitor.
SInce I'm running from WxPython interface how can I do that?
you need to start some monitor, eg. `d.mon start=PNG` and then stop
it. Why are you not using functionality available from wxGUI Map
Display [1]?
About that functionality. d.out.file allows me to define size of output image which is something that I need. WHen I try to do that with the functionality that you mention (e.g. with smaller H and W) I get the error I reported here (http://lists.osgeo.org/pipermail/grass-user/2011-November/062577.html). Michael Barton suggested me to use this function.
I really need to produce output maps with a specific size and with image+scale bar. and when I set HxW I loose Scalebar in my output image.
I'm trying to run d.out.file to produce a PNG file with a defined size (and
others) but I get the following error:
ERROR: You must select a display monitor.
SInce I'm running from WxPython interface how can I do that?
you need to start some monitor, eg. `d.mon start=PNG` and then stop
it. Why are you not using functionality available from wxGUI Map
Display [1]?
[for the record for the list, as I originally sent this from the wrong address]
On 16/11/11 11:55, António Rocha wrote:
Hi Martin
About that functionality. d.out.file allows me to define size of output
image which is something that I need. WHen I try to do that with the
functionality that you mention (e.g. with smaller H and W) I get the
error I reported here
(http://lists.osgeo.org/pipermail/grass-user/2011-November/062577.html).
Michael Barton suggested me to use this function.
I really need to produce output maps with a specific size and with
image+scale bar. and when I set HxW I loose Scalebar in my output image.
I can confirm the issue (António, have you posted a bug report ?). The problem is not that the scalebar "disappears", but that its location is not adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a series of examples.
I can confirm the issue (António, have you posted
a bug report ?). The problem is not that the
scalebar "disappears", but that its location is not
adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a
series of examples.
I'm not sure I fully understand the problem, but
d.out.file has always worked well for me.
the effect of making the width and height of the
image is the same as dragging the xmonitor window
bigger- the barscale and text is still the same size
when viewed at 100% scale. when shrunk to fit on
the screen in an image viewer it becomes tiny.
You can make text and line widths bigger to
compensate but really if you want things to scale
well e.g. for a hi-res poster image, you should
probably be using ps.map, not screen dumps of the
Xmonitors, as the d.* modules were designed for.
barscale and legend are placed as a percentage of
the display frame, so at least their relative
position should stay intact even if the frame gets
bigger.
if y'all think there's a bug please file a detailed
ticket with the steps to reproduce using one of
the standard datasets, and I'll look into it.
I would report this as bug. Or not really?
Antonio
Hamish wrote:
Moritz wrote:
I can confirm the issue (António, have you posted
a bug report ?). The problem is not that the
scalebar "disappears", but that its location is not
adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a
series of examples.
I'm not sure I fully understand the problem, but
d.out.file has always worked well for me.
the effect of making the width and height of the
image is the same as dragging the xmonitor window
bigger- the barscale and text is still the same size
when viewed at 100% scale. when shrunk to fit on
the screen in an image viewer it becomes tiny.
You can make text and line widths bigger to
compensate but really if you want things to scale
well e.g. for a hi-res poster image, you should
probably be using ps.map, not screen dumps of the
Xmonitors, as the d.* modules were designed for.
barscale and legend are placed as a percentage of
the display frame, so at least their relative
position should stay intact even if the frame gets
bigger.
if y'all think there's a bug please file a detailed
ticket with the steps to reproduce using one of
the standard datasets, and I'll look into it.
Hamish
__________ Information from ESET NOD32 Antivirus, version of virus signature database 6639 (20111117) __________
I can confirm the issue (António, have you posted
a bug report ?). The problem is not that the
scalebar "disappears", but that its location is not
adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a
series of examples.
I'm not sure I fully understand the problem, but
d.out.file has always worked well for me.
The original issue I responded to above is not with d.out.file, but with the equivalent option in the wxgui Map Display window. The fact that there is this issue forced António to use d.out.file which then causes the problem the subject line refers to [1].
So, the bug is not with d.out.file, but with the wxgui image export feature.
I can confirm the issue (António, have you posted
a bug report ?). The problem is not that the
scalebar "disappears", but that its location is not
adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a
series of examples.
I'm not sure I fully understand the problem, but
d.out.file has always worked well for me.
AFAIU, it's not about d.out.file. The bug is related to "export to
image" functionality available from wxGUI Map Display.
> Moritz wrote:
>> I can confirm the issue (António, have you
>> posted a bug report ?). The problem is not
>> that the scalebar "disappears", but that its
>> location is not adapted to the changed
>> resolution: see the
>> http://geog-pc40.ulb.ac.be/grass/export_png/
>> for a series of examples.
Hamish:
> I'm not sure I fully understand the problem, but
> d.out.file has always worked well for me.
Martin:
AFAIU, it's not about d.out.file. The bug is
related to "export to image" functionality
available from wxGUI Map Display.
ok, so in the wx Map Display window click on the
"save display to graphic file" icon on the right
side, pick a width and height for your output image
(or a template size), select a filename and image
format to use, and [Save].
to explain to the list, the legend and scalebar
as provided by the wx map display "Add map elements"
icon ("elements" = "decorations"), overlay the main
map composition like a slippy sheet of overhead
transparency plastic with an image on it. You can
then drag the overlay over the background to re-
position it.
but when you export the map composition the overlays
don't get the memo that they should be propor-
tionately place themselves not simply as a fixed
offset from the bottom-left corner. (? I'm not
exactly sure how the overlay positioning works, but
assume that's what's happening)
The quick work-around is for the user to use d.legend
and d.scalebar as "command layers" in the main map
layer wx gui (somewhat hidden under the "add grid
or vector labels" icon) with manual command line
controls. Then the legend or barscale gets rendered
directly as part of map rendering, not overplotted
as a movable overlay.
(seems like the 'add command layer' could use some
work as getting it working was a little brittle,
but that's a matter for another wish ticket..)
but when you export the map composition the overlays
don't get the memo that they should be propor-
tionately place themselves not simply as a fixed
offset from the bottom-left corner. (? I'm not
exactly sure how the overlay positioning works, but
assume that's what's happening)
I confirm. this is what it is happening.
The quick work-around is for the user to use d.legend
and d.scalebar as "command layers" in the main map
layer wx gui (somewhat hidden under the "add grid
or vector labels" icon) with manual command line
controls. Then the legend or barscale gets rendered
directly as part of map rendering, not overplotted
as a movable overlay.
Ok I was able to add a scale bar as command layer. When I export it the recoomended size it is plotted just fine and with a different size it addapted thje scale bar (it remained a bit bigger). Is it possilve to define Scalebar size (not just position)?
Antonio
__________ Information from ESET NOD32 Antivirus, version of virus signature database 6648 (20111121) __________
Hi
Sorry to get back to this question again but I was not able to solve this.
Ok
1- I have plotted my raster
2- I have added a command layer with this d.barscale bcolor=none at=0,90
3- If I use the "Save display to graphic file" functionality it works just fine. But If i try to set a smaller Width and Height:
a) if I place barscale at 0,90 it gets cut
b) If I place barscale at 0,0 it does not get cut but barscale gets over the image
Is there any other suggestion on resizing PNG output without loosing image and barscale?
Another question: when I launch a new Map Display window: Is it possible to define its size?
Thanks
Antonio
Hamish wrote:
Moritz wrote:
I can confirm the issue (António, have you posted
a bug report ?). The problem is not that the
scalebar "disappears", but that its location is not
adapted to the changed resolution: see the http://geog-pc40.ulb.ac.be/grass/export_png/ for a
series of examples.
I'm not sure I fully understand the problem, but
d.out.file has always worked well for me.
the effect of making the width and height of the
image is the same as dragging the xmonitor window
bigger- the barscale and text is still the same size
when viewed at 100% scale. when shrunk to fit on
the screen in an image viewer it becomes tiny.
You can make text and line widths bigger to
compensate but really if you want things to scale
well e.g. for a hi-res poster image, you should
probably be using ps.map, not screen dumps of the
Xmonitors, as the d.* modules were designed for.
barscale and legend are placed as a percentage of
the display frame, so at least their relative
position should stay intact even if the frame gets
bigger.
if y'all think there's a bug please file a detailed
ticket with the steps to reproduce using one of
the standard datasets, and I'll look into it.
Hamish
__________ Information from ESET NOD32 Antivirus, version of virus signature database 6639 (20111117) __________
Is there any other suggestion on resizing PNG output
without loosing image and barscale?
fundamentally if you want to have full cartographic
control or want to make a high-res image suitable
for e.g. a poster or a journal article, you're
going to have to use ps.map. (now made easy with
Anna's new cartographic composer)
you can convert .eps or .ps to PNG if you need to
with a number of tools, here is one way:
d.barscale's height is hardcoded at a fixed number
of pixels high in display/d.barscale/draw_scale.c
as it was only designed to be shown on a computer
monitor or projector at 100% scale.
maybe 'd.barscale -l' does not look so bad when
made (relatively) small?