Hi Moritz,<br><br>hmmm...i&#39;ll try it without the d.out.file command. <br><br>Regarding the segmentation faults: I switched to a different machine to do all this latter work. I havent tried the new scripts on the original machine (my laptop). Both are running 6.4svn.<br>
<br>Meanwhile, I&#39;ve completed the script that creates an automated kml animation...although its a bit specific to my input vector fields..it is here:<br><a href="http://algoesalgo.wordpress.com/2009/04/07/kml-animation-from-vector-polygons/">http://algoesalgo.wordpress.com/2009/04/07/kml-animation-from-vector-polygons/</a><br>
<br><br>Regarding legends, I found that I had to play around way too much to get the legend right. And even then, there&#39;s a yellow color that is not on the legend file, that shows up in the display anyway. So there&#39;s still some strangeness there I think..but I need to check. After that I could perhaps make some recommendations on the legend stuff if that helps improve it..<br>
<br>Thanks again,<br>and everyone, please feel free to comment on the blog where I have put up the code<br>Vishal<br><br><div class="gmail_quote">On Tue, Apr 7, 2009 at 1:26 AM, Moritz Lennert <span dir="ltr">&lt;<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 07/04/09 00:20, Vishal Mehta wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
An update: I got it to ALMOST work using the script below. <br>
</blockquote>
<br></div>
So this means you are not getting segfaults anymore ?<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am attaching the animated gif. But 2 issues remain:<br>
1. I&#39;d like to get a nice legend to display on top right of each display/png<br>
</blockquote>
<br></div>
Did you try the legendfile= parameter of d.thematic.area ? This creates an instructions file which you can feed into d.graph. Feedback on this is more than welcome and we can tweak that output according to your experience. The instructions file is pure text, so you can easily play around with it to find the right settings.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2. I am getting an error as follows for each iteration, even though the output png&#39;s are being exported<br>
/yr is 2090<br>
PNG: GRASS_TRUECOLOR status: TRUE<br>
PNG: collecting to file: pc2090.png,<br>
GRASS_WIDTH=4097, GRASS_HEIGHT=3775<br>
Graphics driver [PNG] started<br>
ERROR: Only X monitors are supported.<br>
</blockquote>
<br></div>
This comes from the use of d.out.file which is useless in your script. d.out.file takes all the commands used to display features on an X-monitor and displays them to a PNG. But when you use a PNG-&quot;Monitor&quot; you are already writing to a file. Just take out the call to d.out.file and you should get the same results without the error message.<br>
<font color="#888888">
<br>
Moritz<br>
<br>
</font><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Monitor &#39;PNG&#39; terminated<br>
yr is 2100<br>
PNG: GRASS_TRUECOLOR status: TRUE<br>
PNG: collecting to file: pc2100.png,<br>
GRASS_WIDTH=4097, GRASS_HEIGHT=3775<br>
Graphics driver [PNG] started<br>
ERROR: Only X monitors are supported.<br>
Monitor &#39;PNG&#39; terminated<br>
/<br>
<br>
I know you&#39;re busy, so whenever you can respond is totally fine- Vishal<br>
-----SCRIPT FOLLOWS----<br>
#!/bin/bash<br>
#generate 5yr interval thematic pngs of low series PPIC population projections<br>
# get current region settings from thematic map of interest<br>
g.region vect=CountyPop2 # Store current environment<br>
OLD_GRASS_WIDTH=$GRASS_WIDTH<br>
OLD_GRASS_HEIGHT=$GRASS_HEIGHT<br>
OLD_GRASS_PNGFILE=$GRASS_PNGFILE<br>
OLD_GRASS_TRANSPARENT=$GRASS_TRANSPARENT<br>
OLD_GRASS_TRUECOLOR=$GRASS_TRUECOLOR<br>
LEGEND_WIDTH=500<br>
LEGEND_HEIGHT=500<br>
LEGEND_TEXT_COLOR=white<br>
BACKGROUND_COLOR=black<br>
# define the driver settings<br>
export GRASS_WIDTH=`g.region -g | grep &quot;cols&quot; | cut -d= -f2`<br>
export GRASS_HEIGHT=`g.region -g | grep &quot;rows&quot; | cut -d= -f2`<br>
export GRASS_TRANSPARENT=FALSE ## if transparent the text overlaps in the animated gif created at the end<br>
export GRASS_TRUECOLOR=TRUE ##<br>
yr=2010<br>
while [ $yr -lt 2105 ] ; do<br>
<br>
echo &quot;yr is $yr &quot;<br>
export GRASS_PNGFILE=pc$yr.png<br>
d.mon start=PNG<br>
d.mon select=PNG<br>
d.thematic.area map=CountyPop2 column=pc$yr breaks=20,40,60 colors=cyan,blue,yellow,red<br>
d.text -b text=&quot;$yr Population&quot; at=50,90 size=4<br>
d.out.file output=$GRASS_PNGFILE format=png<br>
d.mon stop=PNG<br>
#<br>
if [ $yr -eq 2090 ]; then yr=$((yr+10)); else yr=$((yr+5)); fi;<br>
done<br>
#create an animated gif using Image Magick, delay 20/100 sec loop endless<br>
convert -delay 20 -loop 0 *.png population.gif<br>
------<br>
---------------------------------------<br>
<br>
<br></div></div><div class="im">
On Mon, Apr 6, 2009 at 10:32 AM, Moritz Lennert &lt;<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a> &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;&gt; wrote:<br>

<br>
    Thanks. I&#39;ll try to look into this as soon as I find the time (but<br>
    am busy writing a report for a large research project right now...).<br>
    Which version of GRASS are you using ?<br>
<br>
    Moritz<br>
<br>
<br>
    On 06/04/09 19:16, Vishal Mehta wrote:<br>
<br>
        Moritz, thanks much for your interest in this.<br>
<br>
        I&#39;m attaching the shapefile that I used in these past<br>
        conversations. Its California counties, in Latlong WGS84. column<br>
        &#39;pop2000&#39; is 200 population. columns pc2005 to pc2100 are<br>
        percentage changes from pop2000. note that pc2095 is missing<br>
        (the data source is like that).<br>
<br>
        All i&#39;m trying to do is create a nice thematic map with<br>
        consistent colors, and a nice legend; which i&#39;ll then convert<br>
        into an animated kml. I&#39;ve done this with rasters: i can share<br>
        that with you as well.<br>
<br>
        i&#39;ve started a blog to put up some of this stuff:<br>
        <a href="http://algoesalgo.wordpress.com" target="_blank">algoesalgo.wordpress.com</a> &lt;<a href="http://algoesalgo.wordpress.com" target="_blank">http://algoesalgo.wordpress.com</a>&gt;<br>
        &lt;<a href="http://algoesalgo.wordpress.com" target="_blank">http://algoesalgo.wordpress.com</a>&gt;<br>
<br>
        Thanks again,<br>
        Vishal<br>
<br>
<br>
        On Mon, Apr 6, 2009 at 5:29 AM, Moritz Lennert<br>
        &lt;<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;<br></div><div><div></div><div class="h5">
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;&gt;&gt; wrote:<br>
<br>
           Hi again,<br>
<br>
           Would it be possible to send me your files offlist, so that I can<br>
           try to reproduce the error ? Or you could see if you can<br>
        reproduce<br>
           it with one of the GRASS demo datasets ?<br>
<br>
           Moritz<br>
<br>
<br>
           On 04/04/09 01:13, Vishal Mehta wrote:<br>
<br>
               A couple of strange behaviors with a test vector dataset<br>
        whose<br>
               columns are population projections every 5 years:<br>
               I ran the following script below but:<br>
               1. I see it working ok on the x0 monitor; but the output png<br>
               files are all blank..<br>
               2. and i get messages while the script is running that<br>
        include<br>
               &#39;segmentation fault&#39; but not on EVERY iteration of the loop..<br>
<br>
               ---------------------script-------<br>
               #!/bin/bash<br>
               #generate 5yr interval thematic pngs of low series PPIC<br>
               population projectiosn<br>
               yr=2010<br>
               while [ $yr -lt 2105 ] ; do<br>
<br>
               #actions here<br>
               echo &quot;yr is $yr &quot;<br>
<br>
               d.thematic.area map=CountyPop column=pc$yr breaks=20,40,60<br>
               colors=cyan,blue,yellow,red<br>
               d.out.file output=pop$yr format=png<br>
               #<br>
               yr=$((yr+5))<br>
               done<br>
               ------------------------messages while running above<br>
        script-----<br>
<br>
               ---<br>
               yr is 2020<br>
               Segmentation fault<br>
               Saving display from Monitor: [x0] to &lt;pop2020.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               yr is 2025<br>
               Segmentation fault<br>
               Saving display from Monitor: [x0] to &lt;pop2025.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               yr is 2030<br>
               Segmentation fault<br>
               Saving display from Monitor: [x0] to &lt;pop2030.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               yr is 2035<br>
               Saving display from Monitor: [x0] to &lt;pop2035.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               yr is 2040<br>
               Saving display from Monitor: [x0] to &lt;pop2040.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               yr is 2045<br>
               Saving display from Monitor: [x0] to &lt;pop2045.png&gt;.<br>
               Image size [640 x 480]<br>
               Screen export complete. (writing the file may take a small<br>
               amount of time)<br>
               Image crop [523 x 480]<br>
               Done.<br>
               ------<br>
<br>
               On Thu, Apr 2, 2009 at 11:54 PM, Moritz Lennert<br>
               &lt;<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;<br>
               &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;&gt;<br>
               &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;<br>
               &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a><br>
        &lt;mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>&gt;&gt;&gt;&gt; wrote:<br>
<br>
                  On 03/04/09 00:23, Vishal Mehta wrote:<br>
<br>
                      Hello all,<br>
<br>
                      I am better at GRASS raster capabilities than with<br>
        GRASS<br>
               vector<br>
                      handling, so I am writing to get your help.<br>
<br>
                      What I want to do is this:<br>
                      1. I will have one vector dataset of watersheds. Each<br>
               record is<br>
                      a polygon, an individual watershed. There are,<br>
        apart from the<br>
                      usual cat fields, 52 attribute columns. Each attribute<br>
               column is<br>
                      modeled weekly snow depth.<br>
<br>
                      2. I need to automate the display and export to<br>
        png of 52<br>
                      thematic images - one for each week/column -<br>
        keeping the<br>
               color<br>
                      scheme constant throughout. Then all of the images<br>
        will be<br>
                      packaged into a kml animation.<br>
<br>
                      I know how to do the above starting from a stack<br>
        of GRASS<br>
                      rasters, but am not quickly getting a handle on<br>
               displaying GRASS<br>
                      vectors consistently. I&#39;ve tried d.vect and<br>
               d.vect.thematic. I<br>
                      havent tried d.thematic.area yet.<br>
<br>
                      The main issues are that I dont know:<br>
                      - how to assign a constant color scheme  to each map<br>
               (that spans<br>
                      the min and max of all columns); i guess i was<br>
        looking for<br>
                      something as simple as setting color rules like with<br>
               raster data.<br>
<br>
<br>
                  If you want constant class breaks, i.e. the same class<br>
        number and<br>
                  amplitudes linked to the same colors, then you can<br>
        just manually<br>
                  provide breaks and colors in d.thematic.area.<br>
<br>
<br>
                       - how to refer to each attribute column by column<br>
        number<br>
               in a<br>
                      loop (d.vect.thematic and d.thematic.area  seem to<br>
        need<br>
               column<br>
                      name as attribute)<br>
<br>
<br>
                  (assuming you are in a *nix environment with a shell):<br>
                  for col in `<a href="http://v.info" target="_blank">v.info</a> &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt; &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt;<br>
        &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt; -c<br>
<br>
               MapName`; do d.thematic.area<br>
                  .... column=$col; done<br>
                  (note the backticks around the <a href="http://v.info" target="_blank">v.info</a> &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt;<br>
        &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt;<br>
               &lt;<a href="http://v.info" target="_blank">http://v.info</a>&gt; command))<br>
<br>
<br>
                  Moritz<br>
<br>
<br>
<br>
<br>
               --        Vishal K. Mehta, PhD<br>
               Scientist<br>
               Stockholm Environment Institute - US<br>
               133 D St Suite F<br>
               Davis CA 95616<br>
               <a href="http://www.sei-us.org" target="_blank">www.sei-us.org</a> &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt;<br>
        &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt; &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt;<br>
<br>
<br>
<br>
<br>
<br>
<br>
        --         Vishal K. Mehta, PhD<br>
        Scientist<br>
        Stockholm Environment Institute - US<br>
        133 D St Suite F<br>
        Davis CA 95616<br>
        <a href="http://www.sei-us.org" target="_blank">www.sei-us.org</a> &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt; &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt;<br>

<br>
<br>
<br>
<br>
<br>
-- <br>
Vishal K. Mehta, PhD<br>
Scientist<br>
Stockholm Environment Institute - US<br>
133 D St Suite F<br>
Davis CA 95616<br>
<a href="http://www.sei-us.org" target="_blank">www.sei-us.org</a> &lt;<a href="http://www.sei-us.org" target="_blank">http://www.sei-us.org</a>&gt;<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
</blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Vishal K. Mehta, PhD<br>Scientist<br>Stockholm Environment Institute - US<br>133 D St Suite F<br>Davis CA 95616<br><a href="http://www.sei-us.org">www.sei-us.org</a><br>