535{
540 double min, max, tmp;
542
545
547 {
548 elog(ERROR, "BOX2D_construct: arguments must be points");
549 PG_RETURN_NULL();
550 }
551
553 elog(ERROR, "BOX2D_construct: args can not be empty points");
554 PG_RETURN_NULL();
555 }
556
558
559
562 if ( min > max )
563 {
564 tmp = min;
565 min = max;
566 max = tmp;
567 }
570
571
574 if ( min > max )
575 {
576 tmp = min;
577 min = max;
578 max = tmp;
579 }
582
583 PG_RETURN_POINTER(
result);
584}
char result[OUT_DOUBLE_BUFFER_SIZE]
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)