Definition at line 489 of file pgsql2shp-core.c.
490{
491 int i;
492 double x_change,y_change,area;
493 double *x_new, *y_new;
494
495
496 x_new = (
double *)
malloc(
sizeof(
double) * num_points);
497 y_new = (
double *)
malloc(
sizeof(
double) * num_points);
498 area=0.0;
501
502 for (i=0; i < num_points ; i++)
503 {
504 x_new[i] =
x[i] - x_change;
505 y_new[i] =
y[i] - y_change;
506 }
507
508 for (i=0; i < num_points - 1; i++)
509 {
510
511 area += (
x[i] *
y[i+1]) - (y[i] * x[i+1]);
512 }
513 if (area > 0 )
514 {
517 return 0;
518 }
519 else
520 {
523 return 1;
524 }
525}
References free(), and malloc().
Referenced by create_multipolygon(), create_polygon(), and ST_IsPolygonCW().