Definition at line 511 of file pgsql2shp-core.c.
512{
513 int i;
514 double x_change,y_change,area;
515 double *x_new, *y_new;
516
517
518 x_new = (
double *)
malloc(
sizeof(
double) * num_points);
519 y_new = (
double *)
malloc(
sizeof(
double) * num_points);
520 area=0.0;
523
524 for (i=0; i < num_points ; i++)
525 {
526 x_new[i] =
x[i] - x_change;
527 y_new[i] =
y[i] - y_change;
528 }
529
530 for (i=0; i < num_points - 1; i++)
531 {
532
533 area += (
x[i] *
y[i+1]) - (y[i] * x[i+1]);
534 }
535 if (area > 0 )
536 {
539 return 0;
540 }
541 else
542 {
545 return 1;
546 }
547}
References free(), and malloc().
Referenced by create_multipolygon(), and create_polygon().