232{
233
234 uint32_t npoints = 0;
235 uint32_t i;
239
240
241 if (points == NULL) return NULL;
242
243 if (npoints == 0)
244 {
246 if (input_empty)
247 {
249 }
250 else
251 {
252 lwerror(
"Median failed to find non-empty input points with positive weight.");
253 return NULL;
254 }
255 }
256
258
259 i =
iterate_4d(&median, points, npoints, max_iter, tol);
260
262
263 if (fail_if_not_converged && i >= max_iter)
264 {
265 lwerror(
"Median failed to converge within %g after %d iterations.", tol, max_iter);
266 return NULL;
267 }
268
270 {
272 }
273 else
274 {
276 }
277}
LWPOINT * lwpoint_make3dz(int32_t srid, double x, double y, double z)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
#define LW_TRUE
Return types for functions with status returns.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.