buffer.c File Reference

#include <stdlib.h>
#include <math.h>
#include <grass/Vect.h>
#include <grass/gis.h>

Include dependency graph for buffer.c:

Go to the source code of this file.

Defines

#define LENGTH(DX, DY)   ( sqrt( (DX*DX)+(DY*DY) ) )
#define PI   M_PI

Functions

int find_cross (struct line_pnts *Points, int s1, int s2, int s3, int s4, int *s5, int *s6)
int point_in_buf (struct line_pnts *Points, double px, double py, double d)
void clean_parallel (struct line_pnts *Points, struct line_pnts *oPoints, double d, int rm_end)
void parallel_line (struct line_pnts *Points, double d, double tol, struct line_pnts *nPoints)
void Vect_line_parallel (struct line_pnts *InPoints, double distance, double tolerance, int rm_end, struct line_pnts *OutPoints)
 Create parrallel line.
void Vect_line_buffer (struct line_pnts *InPoints, double distance, double tolerance, struct line_pnts *OutPoints)
 Create buffer around the line line. Buffer is closed counter clockwise polygon. Warning: output line may contain loops!


Define Documentation

#define LENGTH ( DX,
DY   )     ( sqrt( (DX*DX)+(DY*DY) ) )

Definition at line 12 of file buffer.c.

#define PI   M_PI

Definition at line 13 of file buffer.c.

Referenced by parallel_line(), and Vect_line_buffer().


Function Documentation

void clean_parallel ( struct line_pnts *  Points,
struct line_pnts *  oPoints,
double  d,
int  rm_end 
)

int find_cross ( struct line_pnts *  Points,
int  s1,
int  s2,
int  s3,
int  s4,
int *  s5,
int *  s6 
)

Definition at line 38 of file buffer.c.

References dig_test_for_intersection().

Referenced by clean_parallel(), and Vect_line_check_intersection().

void parallel_line ( struct line_pnts *  Points,
double  d,
double  tol,
struct line_pnts *  nPoints 
)

int point_in_buf ( struct line_pnts *  Points,
double  px,
double  py,
double  d 
)

Definition at line 82 of file buffer.c.

References dig_distance2_point_to_line().

Referenced by clean_parallel().

void Vect_line_buffer ( struct line_pnts *  InPoints,
double  distance,
double  tolerance,
struct line_pnts *  OutPoints 
)

Create buffer around the line line. Buffer is closed counter clockwise polygon. Warning: output line may contain loops!

Parameters:
InPoints input line
distance 
tolerance maximum distance between theoretical arc and polygon segments
OutPoints output line

Definition at line 343 of file buffer.c.

References PI, Vect_append_point(), Vect_append_points(), Vect_line_parallel(), Vect_line_prune(), Vect_new_line_struct(), and Vect_reset_line().

void Vect_line_parallel ( struct line_pnts *  InPoints,
double  distance,
double  tolerance,
int  rm_end,
struct line_pnts *  OutPoints 
)

Create parrallel line.

Parameters:
InPoints input line
distance 
tolerance maximum distance between theoretical arc and polygon segments
rm_end remove end points falling into distance
OutPoints output line

Definition at line 320 of file buffer.c.

References clean_parallel(), and parallel_line().

Referenced by Vect_line_buffer().


Generated on Sun Apr 6 17:32:45 2008 for GRASS by  doxygen 1.5.5