PostGIS  2.3.7dev-r@@SVN_REVISION@@
Datum BOX2D_out ( PG_FUNCTION_ARGS  )

Definition at line 96 of file lwgeom_box.c.

References GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

97 {
98  GBOX *box = (GBOX *) PG_GETARG_POINTER(0);
99  char tmp[500]; /* big enough */
100  char *result;
101  int size;
102 
103  size = sprintf(tmp,"BOX(%.15g %.15g,%.15g %.15g)",
104  box->xmin, box->ymin, box->xmax, box->ymax);
105 
106  result= palloc(size+1); /* +1= null term */
107  memcpy(result,tmp,size+1);
108  result[size] = '\0';
109 
110  PG_RETURN_CSTRING(result);
111 }
double xmax
Definition: liblwgeom.h:292
double ymin
Definition: liblwgeom.h:293
double xmin
Definition: liblwgeom.h:291
double ymax
Definition: liblwgeom.h:294