PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ asgeojson_bbox_buf()

static size_t asgeojson_bbox_buf ( char *  output,
GBOX bbox,
int  hasz,
int  precision 
)
static

Definition at line 142 of file lwout_geojson.c.

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

Referenced by asgeojson_collection_buf(), asgeojson_line_buf(), asgeojson_multiline_buf(), asgeojson_multipoint_buf(), asgeojson_multipolygon_buf(), asgeojson_point_buf(), and asgeojson_poly_buf().

143 {
144  char *ptr = output;
145 
146  if (!hasz)
147  ptr += sprintf(ptr, "\"bbox\":[%.*f,%.*f,%.*f,%.*f],",
148  precision, bbox->xmin, precision, bbox->ymin,
149  precision, bbox->xmax, precision, bbox->ymax);
150  else
151  ptr += sprintf(ptr, "\"bbox\":[%.*f,%.*f,%.*f,%.*f,%.*f,%.*f],",
152  precision, bbox->xmin, precision, bbox->ymin, precision, bbox->zmin,
153  precision, bbox->xmax, precision, bbox->ymax, precision, bbox->zmax);
154 
155  return (ptr-output);
156 }
double xmax
Definition: liblwgeom.h:295
double zmax
Definition: liblwgeom.h:299
double ymin
Definition: liblwgeom.h:296
double xmin
Definition: liblwgeom.h:294
uint8_t precision
Definition: cu_in_twkb.c:25
double ymax
Definition: liblwgeom.h:297
double zmin
Definition: liblwgeom.h:298
Here is the caller graph for this function: