[GRASS-user] how to calculate area of voronoi polygons considering the boundary of the catchment

daljeet sachdev_dj at yahoo.com
Tue Jul 28 12:42:31 EDT 2009


Hi Moritz,

I am new to GRASS and the basic concepts of this field. Below, I tried my
best to share all the information. Please write if I have missed anything.

List of commands issued in sequence:

//import of shapefile data of country
v.in.ogr -e dsn="IND_adm2.shp" output="Ind_adm2_v" min_area=0.0001 snap=-1

//extract the desired State (in my case it is the state of Kerala)
v.extract input=Ind_adm2_v output=Ind_adm2_ker new=1 where="(Name_1 =
'Kerala')"

//set to region to the vector created for the State
g.region vect=Ind_adm2_ker

//displays as
d.vect Ind_adm2_ker

http://n2.nabble.com/file/n3344342/Ind_adm2_ker.png 

//area of Kerala state
v.report Ind_adm2_ker option=area units=k
cat|area
1|37700.7050169835

//import of rainfall data of the country for a week (available in ascii
format)
v.in.ascii
input="/home/daljeet/grassdata/India_Data_From_DST/india_rain_orig.txt"
output="Ind_rain_orig" format="point" fs="\t" skip=1 columns="x double
precision, y double precision, rain_info double precision" x=2 y=1 z=0 cat=0

//creating the voronoi
v.voronoi input="Ind_rain_orig" output="Ind_rain_ker_vor"

//display the voronoi
d.vect "Ind_rain_ker_vor"

http://n2.nabble.com/file/n3344342/Ind_rain_ker_vor.png 

//overlay
v.overlay ainput="Ind_adm2_ker" atype="area" alayer=1
binput="Ind_rain_ker_vor" btype="area" blayer=1 output="ker_rain_vor_over"
operator="and" olayer=1,0,0

//show the overlaid vector 
d.vect ker_rain_vor_over

http://n2.nabble.com/file/n3344342/ker_rain_vor_over.png 

//storing the area of each polygon to a csv file
v.report ker_rain_vor_over option=area units=k >ker_area.csv --o

attached is the csv file ker_area.csv

http://n2.nabble.com/file/n3344342/ker_area.csv ker_area.csv 

Sum of the area of polygon in the last column is 23881.22 (which is not
equal to the one which is calculated above for Kerala Stata, 
37700.7050169835)

Thanks
Daljeet


Moritz Lennert wrote:
> 
> On 28/07/09 16:02, daljeet wrote:
>> Thanks Moritz.
>> 
>> I was wrongly using the term "region" in my question above. The
>> requirement
>> is slightly different. Let me explain you in detail.
>> 
>> Inputs:
>> 1. I have got the shapefile data of the country. I imported it using
>> v.in.ogr and extracted (v.extract) the vector of the desired "State"
>> using
>> the "where" clause on the attribute which contains the name of the
>> States.
>> So, this means i have the vector of a particular State and its area is
>> available using v.report.
>> 
>> 2. I have also got the rainfall point data for the entire country in the
>> ascii file (x,y,z) for one week (z being the amount of rainfall)
>> 
>> Output required:
>> The volume of rainfall in the particular State (which is extracted
>> above).
>> 
>> What I am doing:
>> I wanted to apply both, the Thiessen polygon and the Isohyetal Method to
>> calculate the volume  of rainfall.
>> 
>> Till now I am only working on Thiessen, and this is what i have done:
>> 1. Imported the ascii rainfall point data (v.in.ascii) in the vector.
>> This
>> is the vector for the whole country.
>> 2. Created the voronoi vector on the above rainfall vector (v.voronoi)
>> 3. Overlaid the voronoi rainfall vector of the country (from step 2) on
>> the
>> extracted vector of the State (from input 1 above) with AND operator.
>> 
>> To verify, the sum of "area of each polygon" on the overlaid vector
>> should
>> be same as area of the extracted State vector.
>> 
>> But this is not coming out to be same. The area of the voronoi overlaid
>> map
>> is smaller than the area of the extracted shape of State.  One
>> observation,
>> the voronoi overlaid map shows some white grids (both inside and at the
>> boundary of the map) and I suspect if these are being taken into account
>> for
>> the area. Attached is the png image of the overlaid vectors. 
>> 
>> http://n2.nabble.com/file/n3342895/rainfall_theissen_png.png 
>> 
>> Any idea what could be my mistake. What I am doing which is making the
>> loss
>> of area in the case of polygons.
> 
> Sorry, cannot help you as such. Start by giving the exact command lines 
> used with each command. Also show the results of v.voronoi. And how did 
> you calculate the areas ?
> 
> Moritz
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 

-- 
View this message in context: http://n2.nabble.com/how-to-calculate-area-of-voronoi-polygons-considering-the-boundary-of-the-catchment-tp3335923p3344342.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list