PostGIS  2.1.10dev-r@@SVN_REVISION@@
static size_t ptarray_to_wkb_size ( const POINTARRAY pa,
uint8_t  variant 
)
static

Definition at line 314 of file lwout_wkb.c.

References POINTARRAY::flags, FLAGS_NDIMS, POINTARRAY::npoints, 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().

315 {
316  int dims = 2;
317  size_t size = 0;
318 
319  if ( variant & (WKB_ISO | WKB_EXTENDED) )
320  dims = FLAGS_NDIMS(pa->flags);
321 
322  /* Include the npoints if it's not a POINT type) */
323  if ( ! ( variant & WKB_NO_NPOINTS ) )
324  size += WKB_INT_SIZE;
325 
326  /* size of the double list */
327  size += pa->npoints * dims * WKB_DOUBLE_SIZE;
328 
329  return size;
330 }
#define WKB_INT_SIZE
int npoints
Definition: liblwgeom.h:327
#define WKB_DOUBLE_SIZE
Well-Known Binary (WKB) Output Variant Types.
uint8_t flags
Definition: liblwgeom.h:325
#define WKB_ISO
Definition: liblwgeom.h:1767
#define WKB_EXTENDED
Definition: liblwgeom.h:1769
#define WKB_NO_NPOINTS
Definition: liblwgeom.h:1773
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:118

Here is the caller graph for this function: