Stores a pointarray as varints in the buffer @register_npoints, controls whether an npoints entry is added to the buffer (used to skip npoints for point types) @dimension, states the dimensionality of object this array is part of (0 = point, 1 = linear, 2 = areal)
Definition at line 107 of file lwout_twkb.c.
115 size_t npoints_offset = 0;
116 uint32_t max_points_left = pa->
npoints;
118 LWDEBUGF(2,
"Entered %s", __func__);
121 if ( pa->
npoints == 0 && register_npoints )
144 if ( register_npoints )
158 for ( i = 0; i < pa->
npoints; i++ )
164 for ( j = 0; j < ndims; j++ )
170 nextdelta[j] = (int64_t) llround(globals->
factor[j] * dbl_ptr[j]) - ts->
accum_rels[j];
171 LWDEBUGF(4,
"deltavalue: %d, ", nextdelta[j]);
172 diff += llabs(nextdelta[j]);
178 if ( i > 0 && diff == 0 && max_points_left > minpoints )
188 for ( j = 0; j < ndims; j++ )
197 for ( j = 0; j < ndims; j++ )
213 if ( register_npoints )
225 if ( register_npoints )
void bytebuffer_destroy_buffer(bytebuffer_t *s)
Free the bytebuffer_t and all memory managed within it.
void bytebuffer_append_bytebuffer(bytebuffer_t *write_to, bytebuffer_t *write_from)
Writes a uint8_t value to the buffer.
void bytebuffer_append_byte(bytebuffer_t *s, const uint8_t val)
Writes a uint8_t value to the buffer.
void bytebuffer_append_uvarint(bytebuffer_t *b, const uint64_t val)
Writes a unsigned varInt to the buffer.
void bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
Writes a signed varInt to the buffer.
void bytebuffer_init_with_size(bytebuffer_t *s, size_t size)
Allocate just the internal buffer of an existing bytebuffer_t struct.
#define FLAGS_NDIMS(flags)
#define LWDEBUGF(level, msg,...)
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
int64_t bbox_min[MAX_N_DIMS]
int64_t accum_rels[MAX_N_DIMS]
int64_t bbox_max[MAX_N_DIMS]
size_t varint_u64_encode_buf(uint64_t val, uint8_t *buf)
References TWKB_STATE::accum_rels, TWKB_STATE::bbox_max, TWKB_STATE::bbox_min, bytebuffer_t::buf_start, bytebuffer_append_byte(), bytebuffer_append_bytebuffer(), bytebuffer_append_uvarint(), bytebuffer_append_varint(), bytebuffer_destroy_buffer(), bytebuffer_init_with_size(), TWKB_GLOBALS::factor, POINTARRAY::flags, FLAGS_NDIMS, TWKB_STATE::geom_buf, getPoint_internal(), LWDEBUGF, MAX_N_DIMS, POINTARRAY::npoints, TWKB_BBOX, TWKB_GLOBALS::variant, varint_u64_encode_buf(), and bytebuffer_t::writecursor.
Referenced by lwline_to_twkb_buf(), lwpoint_to_twkb_buf(), lwpoly_to_twkb_buf(), and lwtriangle_to_twkb_buf().