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

PolyLine. More...

#include <shp-polyline.h>

Public Member Functions

size_t shp_polyline_points (const shp_polyline_t *polyline, size_t part_num, size_t *start, size_t *end)
 Get the points that form a part. More...
 
void shp_polyline_point (const shp_polyline_t *polyline, size_t point_num, shp_point_t *point)
 Get a Point. More...
 

Data Fields

double x_min
 X minimum value.
 
double x_max
 X maximum value.
 
double y_min
 Y minimum value.
 
double y_max
 Y maximum value.
 
size_t num_parts
 Number of parts.
 
size_t num_points
 Total number of points.
 

Detailed Description

A PolyLine consists of one or more parts. A part is a connected sequence of of two or more points. See the "ESRI Shapefile Technical Description" [2] for more information.

Member Function Documentation

◆ shp_polyline_points()

size_t shp_polyline_points ( const shp_polyline_t polyline,
size_t  part_num,
size_t *  start,
size_t *  end 
)

Gets the indices for the points specified by part_num.

Parameters
polylinea polyline.
part_numa zero-based part number.
[out]startthe range start.
[out]endthe range end (exclusive).
Returns
the number of points in the part. At least 2 if the part is valid.
See also
shp_polyline_point

◆ shp_polyline_point()

void shp_polyline_point ( const shp_polyline_t polyline,
size_t  point_num,
shp_point_t point 
)

Gets a Point that belongs to a PolyLine.

Example

// Iterate over all parts and points
size_t part_num, i, n;
for (part_num = 0; part_num < polyline->num_parts; ++part_num) {
shp_polyline_points(polyline, part_num, &i, &n);
while (i < n) {
shp_polyline_point(polyline, i, &point);
++i;
}
}
Point.
Definition: shp-point.h:24
size_t shp_polyline_points(const shp_polyline_t *polyline, size_t part_num, size_t *start, size_t *end)
Get the points that form a part.
Definition: shp-polyline.c:17
void shp_polyline_point(const shp_polyline_t *polyline, size_t point_num, shp_point_t *point)
Get a Point.
Definition: shp-polyline.c:52
Parameters
polylinea PolyLine.
point_numa zero-based point number.
[out]pointa shp_point_t structure.
See also
shp_polyline_points

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