PostGIS  2.3.7dev-r@@SVN_REVISION@@

◆ asgeojson_bbox_buf()

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

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;
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);
155  return (ptr-output);
156 }
double xmax
Definition: liblwgeom.h:292
double zmax
Definition: liblwgeom.h:296
double ymin
Definition: liblwgeom.h:293
double xmin
Definition: liblwgeom.h:291
uint8_t precision
Definition: cu_in_twkb.c:25
double ymax
Definition: liblwgeom.h:294
double zmin
Definition: liblwgeom.h:295
Here is the caller graph for this function: