PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 73 of file lwout_twkb.c.

74{
75 int i;
76 uint8_t buf[16];
77 size_t size = 0;
78 LWDEBUGF(2, "Entered %s", __func__);
79 for ( i = 0; i < ndims; i++ )
80 {
81 size += varint_s64_encode_buf(ts->bbox_min[i], buf);
82 size += varint_s64_encode_buf((ts->bbox_max[i] - ts->bbox_min[i]), buf);
83 }
84 return size;
85}
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
int64_t bbox_min[MAX_N_DIMS]
Definition lwout_twkb.h:93
int64_t bbox_max[MAX_N_DIMS]
Definition lwout_twkb.h:94
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: