PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ BOX2D_out()

Datum BOX2D_out ( PG_FUNCTION_ARGS  )

Definition at line 82 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().

83 {
84  GBOX *box = (GBOX *) PG_GETARG_POINTER(0);
85  char tmp[500]; /* big enough */
86  char *result;
87  int size;
88 
89  size = sprintf(tmp,"BOX(%.15g %.15g,%.15g %.15g)",
90  box->xmin, box->ymin, box->xmax, box->ymax);
91 
92  result= palloc(size+1); /* +1= null term */
93  memcpy(result,tmp,size+1);
94  result[size] = '\0';
95 
96  PG_RETURN_CSTRING(result);
97 }
double xmax
Definition: liblwgeom.h:277
double ymin
Definition: liblwgeom.h:278
double xmin
Definition: liblwgeom.h:276
double ymax
Definition: liblwgeom.h:279
Here is the call graph for this function:
Here is the caller graph for this function: