area.c File Reference

Vector library - area feature related fns. More...

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for area.c:

Go to the source code of this file.

Functions

int Vect_get_area_points (struct Map_info *Map, int area, struct line_pnts *BPoints)
 Returns the polygon array of points in BPoints.
int Vect_get_isle_points (struct Map_info *Map, int isle, struct line_pnts *BPoints)
 Returns the polygon array of points in BPoints.
int Vect_get_area_centroid (struct Map_info *Map, int area)
 Returns centroid number of area.
int Vect_get_area_boundaries (struct Map_info *Map, int area, struct ilist *List)
 Creates list of boundaries for area.
int Vect_get_isle_boundaries (struct Map_info *Map, int isle, struct ilist *List)
 Creates list of boundaries for isle.
int Vect_get_area_num_isles (struct Map_info *Map, int area)
 Returns number of isles for area.
int Vect_get_area_isle (struct Map_info *Map, int area, int isle)
 Returns isle for area.
int Vect_get_isle_area (struct Map_info *Map, int isle)
 Returns area for isle.
double Vect_area_perimeter (struct line_pnts *Points)
 Calculate area perimeter.
int Vect_point_in_area (struct Map_info *Map, int area, double x, double y)
 Returns 1 if point is in area.
double Vect_get_area_area (struct Map_info *Map, int area)
 Returns area of area without areas of isles.
int Vect_get_area_cats (struct Map_info *Map, int area, struct line_cats *Cats)
 Get area categories.
int Vect_get_area_cat (struct Map_info *Map, int area, int field)
 Find FIRST category of given field and area.

Detailed Description

Vector library - area feature related fns.

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
Original author CERL, probably Dave Gerdes or Mike Higgins. Update to GRASS 5.7 Radim Blazek and David D. Gray.
Date:
2001-2008

Definition in file area.c.


Function Documentation

double Vect_area_perimeter ( struct line_pnts *  Points  ) 

Calculate area perimeter.

Parameters:
Points list of points defining area boundary
Returns:
area perimeter

Definition at line 328 of file area.c.

References Vect_line_length().

double Vect_get_area_area ( struct Map_info *  Map,
int  area 
)

Returns area of area without areas of isles.

Parameters:
Map vector map
area area id
Returns:
area of area without areas of isles

Definition at line 379 of file area.c.

References Vect_destroy_line_struct(), Vect_get_area_points(), Vect_get_isle_points(), and Vect_new_line_struct().

Referenced by Vect_remove_small_areas().

int Vect_get_area_boundaries ( struct Map_info *  Map,
int  area,
struct ilist *  List 
)

Creates list of boundaries for area.

Parameters:
Map vector map
area area id
List pointer to list of boundaries
Returns:
number of boundaries

Definition at line 179 of file area.c.

References Vect_list_append(), and Vect_reset_list().

Referenced by Vect_remove_small_areas().

int Vect_get_area_cat ( struct Map_info *  Map,
int  area,
int  field 
)

Find FIRST category of given field and area.

Parameters:
Map vector map
area area id
field layer number
Returns:
first found category of given field
-1 no centroid or no category found

Definition at line 453 of file area.c.

References Vect_get_area_cats(), Vect_new_cats_struct(), and Vect_reset_cats().

int Vect_get_area_cats ( struct Map_info *  Map,
int  area,
struct line_cats *  Cats 
)

Get area categories.

Parameters:
Map vector map
area area id
[out] Cats list of categories
Returns:
0 OK centroid found (but may be without categories)
1 no centroid found

Definition at line 425 of file area.c.

References Vect_get_area_centroid(), Vect_read_line(), and Vect_reset_cats().

Referenced by Vect_get_area_cat().

int Vect_get_area_centroid ( struct Map_info *  Map,
int  area 
)

Returns centroid number of area.

Parameters:
Map vector map
area area id
Returns:
centroid number of area
0 if no centroid found

Definition at line 153 of file area.c.

Referenced by Vect_build_partial(), Vect_get_area_cats(), Vect_overlay_and(), Vect_remove_small_areas(), Vect_set_varray_from_cat_list(), and Vect_set_varray_from_db().

int Vect_get_area_isle ( struct Map_info *  Map,
int  area,
int  isle 
)

Returns isle for area.

Parameters:
Map vector map
area area id
isle isle id
Returns:
isles for area
0 if no isle found

Definition at line 275 of file area.c.

Referenced by Vect_area_buffer2(), and Vect_get_point_in_area().

int Vect_get_area_num_isles ( struct Map_info *  Map,
int  area 
)

Returns number of isles for area.

Parameters:
Map vector map
area area id
Returns:
number of isles for area
0 if area not found

Definition at line 246 of file area.c.

Referenced by Vect_area_buffer2(), and Vect_get_point_in_area().

int Vect_get_area_points ( struct Map_info *  Map,
int  area,
struct line_pnts *  BPoints 
)

Returns the polygon array of points in BPoints.

Parameters:
Map vector map
area area id
[out] BPoints points array
Returns:
number of points
-1 on error

Definition at line 37 of file area.c.

References Vect_append_points(), Vect_new_line_struct(), and Vect_read_line().

Referenced by Vect_area_buffer2(), Vect_get_area_area(), Vect_get_point_in_area(), Vect_isle_find_area(), and Vect_tin_get_z().

int Vect_get_isle_area ( struct Map_info *  Map,
int  isle 
)

Returns area for isle.

Parameters:
Map vector
isle island number
Returns:
area id
0 area not found

Definition at line 302 of file area.c.

Referenced by Vect_select_areas_by_polygon().

int Vect_get_isle_boundaries ( struct Map_info *  Map,
int  isle,
struct ilist *  List 
)

Creates list of boundaries for isle.

Parameters:
Map vector map
isle island number
List pointer to list where boundaries are stored
Returns:
number of boundaries

Definition at line 213 of file area.c.

References Vect_list_append(), and Vect_reset_list().

int Vect_get_isle_points ( struct Map_info *  Map,
int  isle,
struct line_pnts *  BPoints 
)

Returns the polygon array of points in BPoints.

Parameters:
Map vector map
isle island id
[out] BPoints points array
Returns:
number of points or -1 on error

Definition at line 98 of file area.c.

References Vect_append_points(), Vect_new_line_struct(), and Vect_read_line().

Referenced by Vect_area_buffer2(), Vect_find_island(), Vect_get_area_area(), and Vect_get_point_in_area().

int Vect_point_in_area ( struct Map_info *  Map,
int  area,
double  x,
double  y 
)

Returns 1 if point is in area.

Parameters:
Map vector map
area area id
x,y point coordinates
Returns:
1 if point is in area
0 if not

Definition at line 344 of file area.c.

References Vect_point_in_area_outer_ring(), and Vect_point_in_island().

Referenced by Vect_find_area().


Generated on Sat Oct 24 03:25:21 2009 for GRASS Programmer's Manual by  doxygen 1.6.1