PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ BOX2D_out()

Datum BOX2D_out ( PG_FUNCTION_ARGS  )

Definition at line 96 of file lwgeom_box.c.

References LWGEOM_to_BOX2D(), PG_FUNCTION_INFO_V1(), GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by BOX2D_in().

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:295
double ymin
Definition: liblwgeom.h:296
double xmin
Definition: liblwgeom.h:294
double ymax
Definition: liblwgeom.h:297
Here is the call graph for this function:
Here is the caller graph for this function: