[GRASS-user] displaying many thematic maps from one vector dataset

Vishal Mehta vishalm1975 at gmail.com
Fri Apr 3 19:13:14 EDT 2009


A couple of strange behaviors with a test vector dataset whose columns are
population projections every 5 years:
I ran the following script below but:
1. I see it working ok on the x0 monitor; but the output png files are all
blank..
2. and i get messages while the script is running that include 'segmentation
fault' but not on EVERY iteration of the loop..

---------------------script-------
#!/bin/bash
#generate 5yr interval thematic pngs of low series PPIC population
projectiosn
yr=2010
while [ $yr -lt 2105 ] ; do

#actions here
echo "yr is $yr "

d.thematic.area map=CountyPop column=pc$yr breaks=20,40,60
colors=cyan,blue,yellow,red
d.out.file output=pop$yr format=png
#
yr=$((yr+5))
done
------------------------messages while running above script-----

---
yr is 2020
Segmentation fault
Saving display from Monitor: [x0] to <pop2020.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
yr is 2025
Segmentation fault
Saving display from Monitor: [x0] to <pop2025.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
yr is 2030
Segmentation fault
Saving display from Monitor: [x0] to <pop2030.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
yr is 2035
Saving display from Monitor: [x0] to <pop2035.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
yr is 2040
Saving display from Monitor: [x0] to <pop2040.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
yr is 2045
Saving display from Monitor: [x0] to <pop2045.png>.
Image size [640 x 480]
Screen export complete. (writing the file may take a small amount of time)
Image crop [523 x 480]
Done.
------

On Thu, Apr 2, 2009 at 11:54 PM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:

> On 03/04/09 00:23, Vishal Mehta wrote:
>
>> Hello all,
>>
>> I am better at GRASS raster capabilities than with GRASS vector handling,
>> so I am writing to get your help.
>>
>> What I want to do is this:
>> 1. I will have one vector dataset of watersheds. Each record is a polygon,
>> an individual watershed. There are, apart from the usual cat fields, 52
>> attribute columns. Each attribute column is modeled weekly snow depth.
>>
>> 2. I need to automate the display and export to png of 52 thematic images
>> - one for each week/column - keeping the color scheme constant throughout.
>> Then all of the images will be packaged into a kml animation.
>>
>> I know how to do the above starting from a stack of GRASS rasters, but am
>> not quickly getting a handle on displaying GRASS vectors consistently. I've
>> tried d.vect and d.vect.thematic. I havent tried d.thematic.area yet.
>>
>> The main issues are that I dont know:
>> - how to assign a constant color scheme  to each map (that spans the min
>> and max of all columns); i guess i was looking for something as simple as
>> setting color rules like with raster data.
>>
>
> If you want constant class breaks, i.e. the same class number and
> amplitudes linked to the same colors, then you can just manually provide
> breaks and colors in d.thematic.area.
>
>   - how to refer to each attribute column by column number in a loop
>> (d.vect.thematic and d.thematic.area  seem to need column name as attribute)
>>
>
> (assuming you are in a *nix environment with a shell):
> for col in `v.info -c MapName`; do d.thematic.area .... column=$col; done
> (note the backticks around the v.info command))
>
> Moritz
>



-- 
Vishal K. Mehta, PhD
Scientist
Stockholm Environment Institute - US
133 D St Suite F
Davis CA 95616
www.sei-us.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090403/8aa12fbd/attachment.html


More information about the grass-user mailing list