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

PolygonM. More...

#include <shp-polygonm.h>

Public Member Functions

size_t shp_polygonm_points (const shp_polygonm_t *polygonm, size_t part_num, size_t *start, size_t *end)
 Get the points that form a part. More...
 
void shp_polygonm_pointm (const shp_polygonm_t *polygonm, size_t point_num, shp_pointm_t *pointm)
 Get a PointM. 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.
 
double m_min
 M minimum value.
 
double m_max
 M maximum value.
 
size_t num_parts
 Number of parts.
 
size_t num_points
 Total number of points.
 

Detailed Description

A PolygonM consists of one or more parts. A part is a connected sequence of four or more points that form a closed, non-self-intersecting loop. Each point is associated with a measure, for example a temperature.

Member Function Documentation

◆ shp_polygonm_points()

size_t shp_polygonm_points ( const shp_polygonm_t polygonm,
size_t  part_num,
size_t *  start,
size_t *  end 
)

Gets the indices for the points specified by part_num.

Parameters
polygonma PolygonM.
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 4 if the part is valid.
See also
shp_polygonm_pointm

◆ shp_polygonm_pointm()

void shp_polygonm_pointm ( const shp_polygonm_t polygonm,
size_t  point_num,
shp_pointm_t pointm 
)

Gets a PointM that belongs to the edges of a PolygonM.

Example

// Iterate over all parts and points
size_t part_num, i, n;
shp_pointm_t pointm;
for (part_num = 0; part_num < polygonm->num_parts; ++part_num) {
shp_polygonm_points(polygonm, part_num, &i, &n);
while (i < n) {
shp_polygonm_pointm(polygonm, i, &pointm);
++i;
}
}
PointM.
Definition: shp-pointm.h:25
void shp_polygonm_pointm(const shp_polygonm_t *polygonm, size_t point_num, shp_pointm_t *pointm)
Get a PointM.
Definition: shp-polygonm.c:52
size_t shp_polygonm_points(const shp_polygonm_t *polygonm, size_t part_num, size_t *start, size_t *end)
Get the points that form a part.
Definition: shp-polygonm.c:17
Parameters
polygonma PolygonM.
point_numa zero-based point number.
[out]pointma shp_pointm_t structure.
See also
shp_polygonm_points

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