GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <math.h>
#include <stdlib.h>
#include <grass/Vect.h>
#include <grass/gis.h>
#include <grass/linkm.h>
#include <grass/glocale.h>
Go to the source code of this file.
Data Structures | |
struct | Slink |
Functions | |
int | Vect__intersect_line_with_poly () |
int | Vect_get_point_in_area (struct Map_info *Map, int area, double *X, double *Y) |
Get point inside area and outside all islands. More... | |
int | Vect__intersect_line_with_poly (struct line_pnts *Points, double y, struct line_pnts *Inter) |
int | Vect_get_point_in_poly (struct line_pnts *Points, double *X, double *Y) |
Get point inside polygon. More... | |
int | Vect_find_poly_centroid (struct line_pnts *points, double *cent_x, double *cent_y) |
Get centroid of polygon. More... | |
int | Vect_get_point_in_poly_isl (struct line_pnts *Points, struct line_pnts **IPoints, int n_isles, double *att_x, double *att_y) |
Get point inside polygon but outside the islands specifiled in IPoints. More... | |
int | Vect_point_in_poly (double X, double Y, struct line_pnts *Points) |
Determines if a point (X,Y) is inside a polygon. More... | |
int | Vect_point_in_area_outer_ring (double X, double Y, struct Map_info *Map, int area) |
Determines if a point (X,Y) is inside an area outer ring. Islands are not considered. More... | |
int | Vect_point_in_island (double X, double Y, struct Map_info *Map, int isle) |
Determines if a point (X,Y) is inside an island. More... | |
int Vect__intersect_line_with_poly | ( | ) |
Referenced by Vect_get_point_in_poly_isl().
int Vect__intersect_line_with_poly | ( | struct line_pnts * | Points, |
double | y, | ||
struct line_pnts * | Inter | ||
) |
Definition at line 141 of file Vlib/poly.c.
References b, and Vect_append_point().
int Vect_find_poly_centroid | ( | struct line_pnts * | points, |
double * | cent_x, | ||
double * | cent_y | ||
) |
Get centroid of polygon.
points | polygon | |
[out] | cent_x,cent_y | centroid coordinates |
Definition at line 330 of file Vlib/poly.c.
Referenced by Vect_get_point_in_poly(), and Vect_get_point_in_poly_isl().
Get point inside area and outside all islands.
Take a line and intersect it with the polygon and any islands. sort the list of X values from these intersections. This will be a list of segments alternating IN/OUT/IN/OUT of the polygon. Pick the largest IN segment and take the midpoint.
Map | vector map | |
area | area id | |
[out] | X,Y | point coordinateds |
Definition at line 61 of file Vlib/poly.c.
References G_debug(), NULL, Vect_get_area_isle(), Vect_get_area_num_isles(), Vect_get_area_points(), Vect_get_isle_points(), Vect_get_point_in_poly_isl(), and Vect_new_line_struct().
Referenced by wxdigit.IVDigit::InitCats().
int Vect_get_point_in_poly | ( | struct line_pnts * | Points, |
double * | X, | ||
double * | Y | ||
) |
Get point inside polygon.
This does NOT consider ISLANDS!
Points | polygon | |
[out] | X,Y | point coordinates |
Definition at line 180 of file Vlib/poly.c.
References G_debug(), G_warning(), link_exit_on_error(), link_init(), link_new(), Slink::next, NULL, Vect_find_poly_centroid(), Vect_point_in_poly(), and Slink::x.
int Vect_get_point_in_poly_isl | ( | struct line_pnts * | Points, |
struct line_pnts ** | IPoints, | ||
int | n_isles, | ||
double * | att_x, | ||
double * | att_y | ||
) |
Get point inside polygon but outside the islands specifiled in IPoints.
Take a line and intersect it with the polygon and any islands. sort the list of X values from these intersections. This will be a list of segments alternating IN/OUT/IN/OUt of the polygon. Pick the largest IN segment and take the midpoint.
Points | polygon | |
IPoints | isles | |
n_isles | number of isles | |
[out] | att_x,att_y | point coordinates |
Definition at line 424 of file Vlib/poly.c.
References G_debug(), max, Vect__intersect_line_with_poly(), Vect_find_poly_centroid(), Vect_new_line_struct(), Vect_point_in_poly(), and y.
Referenced by Vect_get_point_in_area().
Determines if a point (X,Y) is inside an area outer ring. Islands are not considered.
X,Y | point coordinates |
Map | vector map |
area | area id |
Definition at line 695 of file Vlib/poly.c.
References first, G_debug(), NULL, Vect_new_line_struct(), and Vect_read_line().
Referenced by Vect_isle_find_area(), and Vect_point_in_area().
Determines if a point (X,Y) is inside an island.
X,Y | point coordinates |
Map | vector map |
isle | isle id |
Definition at line 760 of file Vlib/poly.c.
References first, G_debug(), NULL, Vect_new_line_struct(), and Vect_read_line().
Referenced by Vect_find_island(), and Vect_point_in_area().
int Vect_point_in_poly | ( | double | X, |
double | Y, | ||
struct line_pnts * | Points | ||
) |
Determines if a point (X,Y) is inside a polygon.
X,Y | point coordinates |
Points | polygon |
Definition at line 665 of file Vlib/poly.c.
References G_debug().
Referenced by wxdisplay.DisplayDriver::SelectLinesByBox(), Vect_get_point_in_poly(), Vect_get_point_in_poly_isl(), and Vect_select_lines_by_polygon().