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

Definition at line 83 of file lwgeom_box.c.

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

84 {
85  GBOX *box = (GBOX *) PG_GETARG_POINTER(0);
86  char tmp[500]; /* big enough */
87  char *result;
88  int size;
89 
90  size = sprintf(tmp,"BOX(%.15g %.15g,%.15g %.15g)",
91  box->xmin, box->ymin, box->xmax, box->ymax);
92 
93  result= palloc(size+1); /* +1= null term */
94  memcpy(result,tmp,size+1);
95  result[size] = '\0';
96 
97  PG_RETURN_CSTRING(result);
98 }
double xmax
Definition: liblwgeom.h:249
char ** result
Definition: liblwgeom.h:218
double ymin
Definition: liblwgeom.h:250
double xmin
Definition: liblwgeom.h:248
double ymax
Definition: liblwgeom.h:251