*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.60 2001/10/25 05:49:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.61 2002/05/14 18:16:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PG_RETURN_FLOAT8(fabs(l1->C - l2->C));
tmp = point_construct(0.0, l1->C);
result = dist_pl_internal(tmp, l2);
- pfree(tmp);
PG_RETURN_FLOAT8(result);
}
retval = true; /* interpt on l1 and l2 */
else
retval = false;
- if (interpt != NULL)
- pfree(interpt);
return retval;
}
*/
if (!on_ps_internal(result, l1) ||
!on_ps_internal(result, l2))
- {
- pfree(result);
PG_RETURN_NULL();
- }
/*
* If there is an intersection, then check explicitly for matching
ln->A, ln->B, ln->C, pt->x, pt->y, m);
#endif
-/*
- * Calculate distance to the line segment
- * or to the endpoints of the segment.
- */
+ /*
+ * Calculate distance to the line segment
+ * or to the endpoints of the segment.
+ */
/* intersection is on the line segment? */
if ((ip = interpt_sl(lseg, ln)) != NULL)
printf("dist_ps- distance is %f to intersection point is (%f,%f)\n",
result, ip->x, ip->y);
#endif
- pfree(ip);
}
else
{
result = tmpdist;
}
- pfree(ln);
-
return result;
}
Point *pt = PG_GETARG_POINT_P(0);
BOX *box = PG_GETARG_BOX_P(1);
float8 result;
- Point *tmp;
+ Point *near;
- tmp = DatumGetPointP(DirectFunctionCall2(close_pb,
- PointPGetDatum(pt),
- BoxPGetDatum(box)));
- result = point_dt(tmp, pt);
- pfree(tmp);
+ near = DatumGetPointP(DirectFunctionCall2(close_pb,
+ PointPGetDatum(pt),
+ BoxPGetDatum(box)));
+ result = point_dt(near, pt);
PG_RETURN_FLOAT8(result);
}
result = DirectFunctionCall2(dist_pb,
PointPGetDatum(tmp),
BoxPGetDatum(box));
- pfree(tmp);
PG_RETURN_DATUM(result);
}
BOX *box = PG_GETARG_BOX_P(1);
#endif
- /* think about this one for a while */
+ /* need to think about this one for a while */
elog(ERROR, "dist_lb not implemented");
PG_RETURN_NULL();
}
else
{
- pfree(p);
p = NULL;
}
}
tmp = interpt_sl(lseg, line);
if (tmp)
- {
- pfree(tmp);
return true;
- }
return false;
}
PointPGetDatum(&l2->p[0]),
LsegPGetDatum(l1)));
memcpy(&point, result, sizeof(Point));
- pfree(result);
result = DatumGetPointP(DirectFunctionCall2(close_ps,
PointPGetDatum(&point),
LsegPGetDatum(l2)));
if ((d = dist_ps_internal(&l2->p[1], l1)) < dist)
{
- if (result != NULL)
- pfree(result);
-
result = DatumGetPointP(DirectFunctionCall2(close_ps,
PointPGetDatum(&l2->p[1]),
LsegPGetDatum(l1)));
memcpy(&point, result, sizeof(Point));
- pfree(result);
result = DatumGetPointP(DirectFunctionCall2(close_ps,
PointPGetDatum(&point),
LsegPGetDatum(l2)));
result = box_construct(high->x, low->x, high->y, low->y);
- pfree(high);
- pfree(low);
-
PG_RETURN_BOX_P(result);
}
result = box_construct(high->x, low->x, high->y, low->y);
- pfree(high);
- pfree(low);
-
PG_RETURN_BOX_P(result);
}
PointPGetDatum(point)));
path->p[i].x = p->x;
path->p[i].y = p->y;
- pfree(p);
}
PG_RETURN_PATH_P(path);
PointPGetDatum(point)));
path->p[i].x = p->x;
path->p[i].y = p->y;
- pfree(p);
}
PG_RETURN_PATH_P(path);
PolygonPGetDatum(poly)));
result = DirectFunctionCall1(circle_center,
CirclePGetDatum(circle));
- pfree(circle);
PG_RETURN_DATUM(result);
}
PointPGetDatum(point)));
result->center.x = p->x;
result->center.y = p->y;
- pfree(p);
result->radius *= HYPOT(point->x, point->y);
PG_RETURN_CIRCLE_P(result);
PointPGetDatum(point)));
result->center.x = p->x;
result->center.y = p->y;
- pfree(p);
result->radius /= HYPOT(point->x, point->y);
PG_RETURN_CIRCLE_P(result);