shapereader
Read ESRI shapefiles
Public Member Functions | Data Fields
shp_point_t Struct Reference

Point. More...

#include <shp-point.h>

Public Member Functions

int shp_point_in_bounding_box (const shp_point_t *point, double x_min, double y_min, double x_max, double y_max)
 Check whether a point is in a bounding box. More...
 
int shp_point_in_polygon (const shp_point_t *point, const shp_polygon_t *polygon)
 Check whether a point is in a polygon. More...
 

Data Fields

double x
 X coordinate.
 
double y
 Y coordinate.
 

Detailed Description

A location in a two-dimensional coordinate plane.

Member Function Documentation

◆ shp_point_in_bounding_box()

int shp_point_in_bounding_box ( const shp_point_t point,
double  x_min,
double  y_min,
double  x_max,
double  y_max 
)

Determines whether a point is inside or outside a bounding box.

Parameters
pointa point.
x_minX coordinate of the bottom left corner.
y_minY coordinate of the bottom left corner.
x_maxX coordinate of the top right corner.
y_maxY coordinate of the top right corner.
Return values
1if the point is in the box.
0if the point is not in the box.
-1if the point is on the boundary.
See also
shp_point_in_polygon

◆ shp_point_in_polygon()

int shp_point_in_polygon ( const shp_point_t point,
const shp_polygon_t polygon 
)

Determines whether a point is inside or outside a polygon.

Parameters
pointa point.
polygona polygon.
Return values
1if the point is in the polygon.
0if the point is not in the polygon.
-1if the point is on the polygon's edges.
See also
shp_point_in_bounding_box
"Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons" [3] for a description of the point-in-polygon algorithm.

The documentation for this struct was generated from the following files: