PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ sizeof_bbox()

static size_t sizeof_bbox ( TWKB_STATE ts,
int  ndims 
)
static

Calculates the size of the bbox in varints in the form: xmin, xdelta, ymin, ydelta.

Definition at line 72 of file lwout_twkb.c.

73 {
74  int i;
75  uint8_t buf[16];
76  size_t size = 0;
77  LWDEBUGF(2, "Entered %s", __func__);
78  for ( i = 0; i < ndims; i++ )
79  {
80  size += varint_s64_encode_buf(ts->bbox_min[i], buf);
81  size += varint_s64_encode_buf((ts->bbox_max[i] - ts->bbox_min[i]), buf);
82  }
83  return size;
84 }
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
int64_t bbox_min[MAX_N_DIMS]
Definition: lwout_twkb.h:93
int64_t bbox_max[MAX_N_DIMS]
Definition: lwout_twkb.h:94
unsigned char uint8_t
Definition: uthash.h:79
size_t varint_s64_encode_buf(int64_t val, uint8_t *buf)
Definition: varint.c:89

References TWKB_STATE::bbox_max, TWKB_STATE::bbox_min, LWDEBUGF, and varint_s64_encode_buf().

Referenced by lwgeom_write_to_buffer().

Here is the call graph for this function:
Here is the caller graph for this function: