534{
539 double min, max, tmp;
541
544
546 {
547 elog(ERROR, "BOX2D_construct: arguments must be points");
548 PG_RETURN_NULL();
549 }
550
552 elog(ERROR, "BOX2D_construct: args can not be empty points");
553 PG_RETURN_NULL();
554 }
555
557
558
561 if ( min > max )
562 {
563 tmp = min;
564 min = max;
565 max = tmp;
566 }
569
570
573 if ( min > max )
574 {
575 tmp = min;
576 min = max;
577 max = tmp;
578 }
581
582 PG_RETURN_POINTER(result);
583}
GBOX * gbox_new(lwflags_t flags)
Create a new gbox with the dimensionality indicated by the flags.
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
double lwpoint_get_x(const LWPOINT *point)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
double lwpoint_get_y(const LWPOINT *point)
int lwpoint_is_empty(const LWPOINT *point)