[GRASSLIST:9336] Re: Extracting and sum values in a tab

ivan marchesini marchesini at unipg.it
Tue Dec 6 07:54:02 EST 2005


You should use v.reclass for obtaining a map (PIPPO.map) where each area
feaure has a cat described by the region value (before this you should
give an integer code to the region column, for example A=1 B=2, and so
on.., or creating a new column named for example region.int )
later yuou can use the sql command 

create table PIPPO as select REGION.INT, sum( TOTAL_POPULATION) from
YOUR_TABLE group by REGION.INT

for creating a new table called pippo where you have the region code
(1,2,3,....) and the sum of the area values for each code...

later, using v.db.connect, you can connect the PIPPO.map to the PIPPO
table using the region code as a key...

hope this help....

Ivan







Il giorno lun, 05-12-2005 alle 19:43 +0000, Luca Casagrande ha scritto:
> Hi guys
> 
> I have got an area vector layer that describes the extension of different 
> cities and also the region in where them are; the table associated is 
> something like this:
> 
> REGION		CITY		EXTENSION	
>     A			test1			100000
>     A			test2			5000
>     B			........			20000
>     C                 ........			300000
> 
> I'd like to create a surface layer that describes the extensionof each region 
> and with a tab like this one:
> 
> REGION			TOTAL POPULATION
> 	A				Sum of all
> 	B				Sum of all
> 	C				Sum of all
> 
> Can this be done?
> 
> Thx
> Luca	
> 
> 
-- 
Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a 
06125
Perugia (Italy)
e-mail: marchesini at unipg.it
        ivan.marchesini at gmail.com
tel: +39(0)755853760
fax: +39(0)755853756







More information about the grass-user mailing list