PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ptarray_to_wkb_size()

static size_t ptarray_to_wkb_size ( const POINTARRAY pa,
uint8_t  variant 
)
static

Definition at line 353 of file lwout_wkb.c.

354 {
355  int dims = 2;
356  size_t size = 0;
357 
358  if ( variant & (WKB_ISO | WKB_EXTENDED) )
359  dims = FLAGS_NDIMS(pa->flags);
360 
361  /* Include the npoints if it's not a POINT type) */
362  if ( ! ( variant & WKB_NO_NPOINTS ) )
363  size += WKB_INT_SIZE;
364 
365  /* size of the double list */
366  size += pa->npoints * dims * WKB_DOUBLE_SIZE;
367 
368  return size;
369 }
static uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_ISO
Definition: liblwgeom.h:2066
#define WKB_NO_NPOINTS
Definition: liblwgeom.h:2072
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
#define WKB_EXTENDED
Definition: liblwgeom.h:2068
#define WKB_INT_SIZE
#define WKB_DOUBLE_SIZE
Well-Known Binary (WKB) Output Variant Types.
uint32_t npoints
Definition: liblwgeom.h:374
uint8_t flags
Definition: liblwgeom.h:372

References POINTARRAY::flags, FLAGS_NDIMS, POINTARRAY::npoints, variant, WKB_DOUBLE_SIZE, WKB_EXTENDED, WKB_INT_SIZE, WKB_ISO, and WKB_NO_NPOINTS.

Referenced by lwline_to_wkb_size(), lwpoint_to_wkb_size(), lwpoly_to_wkb_size(), and lwtriangle_to_wkb_size().

Here is the caller graph for this function: