PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ BOX3D_out()

Datum BOX3D_out ( PG_FUNCTION_ARGS  )

Definition at line 135 of file lwgeom_box3d.c.

References BOX3D_to_BOX2D(), MAX_DIGS_DOUBLE, PG_FUNCTION_INFO_V1(), BOX3D::xmax, BOX3D::xmin, BOX3D::ymax, BOX3D::ymin, BOX3D::zmax, and BOX3D::zmin.

Referenced by BOX3D_in().

136 {
137  BOX3D *bbox = (BOX3D *) PG_GETARG_POINTER(0);
138  int size;
139  char *result;
140 
141  if (bbox == NULL)
142  {
143  result = palloc(5);
144  strcat(result,"NULL");
145  PG_RETURN_CSTRING(result);
146  }
147 
148 
149  /*double digits+ "BOX3D"+ "()" + commas +null */
150  size = MAX_DIGS_DOUBLE*6+5+2+4+5+1;
151 
152  result = (char *) palloc(size);
153 
154  sprintf(result, "BOX3D(%.15g %.15g %.15g,%.15g %.15g %.15g)",
155  bbox->xmin, bbox->ymin, bbox->zmin,
156  bbox->xmax,bbox->ymax,bbox->zmax);
157 
158  PG_RETURN_CSTRING(result);
159 }
double ymin
Definition: liblwgeom.h:279
double xmin
Definition: liblwgeom.h:279
#define MAX_DIGS_DOUBLE
Definition: lwgeom_box3d.c:42
double xmax
Definition: liblwgeom.h:280
double ymax
Definition: liblwgeom.h:280
double zmax
Definition: liblwgeom.h:280
double zmin
Definition: liblwgeom.h:279
Here is the call graph for this function:
Here is the caller graph for this function: