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 106 of file lwout_twkb.c.
114 size_t npoints_offset = 0;
117 LWDEBUGF(2,
"Entered %s", __func__);
120 if ( pa->
npoints == 0 && register_npoints )
143 if ( register_npoints )
157 for ( i = 0; i < pa->
npoints; i++ )
163 for ( j = 0; j < ndims; j++ )
169 nextdelta[j] = (int64_t) llround(globals->
factor[j] * dbl_ptr[j]) - ts->
accum_rels[j];
170 LWDEBUGF(4,
"deltavalue: %d, ", nextdelta[j]);
171 diff += llabs(nextdelta[j]);
177 if ( i > 0 && diff == 0 && max_points_left > minpoints )
187 for ( j = 0; j < ndims; j++ )
196 for ( j = 0; j < ndims; j++ )
212 if ( register_npoints )
224 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.
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
#define FLAGS_NDIMS(flags)
#define LWDEBUGF(level, msg,...)
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(), and lwpoly_to_twkb_buf().