PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ asgeojson_bbox_buf()

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

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

129 {
130  char *ptr = output;
131 
132  if (!hasz)
133  ptr += sprintf(ptr, "\"bbox\":[%.*f,%.*f,%.*f,%.*f],",
134  precision, bbox->xmin, precision, bbox->ymin,
135  precision, bbox->xmax, precision, bbox->ymax);
136  else
137  ptr += sprintf(ptr, "\"bbox\":[%.*f,%.*f,%.*f,%.*f,%.*f,%.*f],",
138  precision, bbox->xmin, precision, bbox->ymin, precision, bbox->zmin,
139  precision, bbox->xmax, precision, bbox->ymax, precision, bbox->zmax);
140 
141  return (ptr-output);
142 }
double xmax
Definition: liblwgeom.h:277
double zmax
Definition: liblwgeom.h:281
double ymin
Definition: liblwgeom.h:278
double xmin
Definition: liblwgeom.h:276
uint8_t precision
Definition: cu_in_twkb.c:25
double ymax
Definition: liblwgeom.h:279
double zmin
Definition: liblwgeom.h:280
Here is the caller graph for this function: