63 if (2 == (newln->
dims = gln->
dims)) {
69 for (i = 0; i < np; i++) {
70 newln->
p2[i][
X] = gln->
p2[i][
X];
71 newln->
p2[i][
Y] = gln->
p2[i][
Y];
80 for (i = 0; i < np; i++) {
81 newln->
p3[i][
X] = gln->
p3[i][
X];
82 newln->
p3[i][
Y] = gln->
p3[i][
Y];
83 newln->
p3[i][
Z] = gln->
p3[i][
Z];
113 targp = (int)(gln->
npts / factor);
121 if (2 == (newln->
dims = gln->
dims)) {
128 for (i = 0; i < targp; i++) {
129 if (i == targp - 1) {
130 nextp = gln->
npts - 1;
133 nextp = (int)((i * (gln->
npts - 1)) / (targp - 1));
136 newln->
p2[i][
X] = gln->
p2[nextp][
X];
137 newln->
p2[i][
Y] = gln->
p2[nextp][
Y];
147 for (i = 0; i < targp; i++) {
148 if (i == targp - 1) {
149 nextp = gln->
npts - 1;
152 nextp = (int)((i * (gln->
npts - 1)) / (targp - 1));
155 newln->
p3[i][
X] = gln->
p3[nextp][
X];
156 newln->
p3[i][
Y] = gln->
p3[nextp][
Y];
157 newln->
p3[i][
Z] = gln->
p3[nextp][
Z];
178 for (n = 0; n < gln->
npts - 1; n++) {
202 for (tln = gln; tln; tln = tln->
next) {
233 int T_pts, A_ppl, N_s;
234 float decim_factor, slength[
MFAST_LNS], T_slength, A_slength;
251 for (gln = gv->
lines; gln; gln = gln->
next) {
252 if (gln->
npts > A_ppl) {
254 prev->
next = thin_line(gln, decim_factor);
258 prev = gv->
fastlines = thin_line(gln, decim_factor);
266 A_slength = T_slength / N_s;
269 for (gln = gv->
lines; gln; gln = gln->
next) {
270 if (gln->
npts <= A_ppl) {
272 if (slength[N_s++] > A_slength) {
274 prev->
next = copy_line(gln);
285 G_debug(3,
"Decimated lines have %d points.",
int G_debug(int, const char *,...) __attribute__((format(printf
float GS_P2distance(float *, float *)
Calculate distance in plane.
float GS_distance(float *, float *)
Calculate distance.
#define TFAST_PTS
target number of desired points to represent entire file
#define MFAST_LNS
max number of lines desired
float gv_line_length(geoline *gln)
Get line width.
int gln_num_points(geoline *gln)
Get number of line vertices.
int gv_num_points(geovect *gv)
Get number of points in vector.
int gv_decimate_lines(geovect *gv)
Decimate line.