PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t lwline_to_wkb_size ( const LWLINE line,
uint8_t  variant 
)
static

Definition at line 447 of file lwout_wkb.c.

References empty_to_wkb_size(), lwgeom_is_empty(), lwgeom_wkb_needs_srid(), LWLINE::points, ptarray_to_wkb_size(), WKB_BYTE_SIZE, WKB_EXTENDED, and WKB_INT_SIZE.

Referenced by lwgeom_to_wkb_size().

448 {
449  /* Endian flag + type number */
450  size_t size = WKB_BYTE_SIZE + WKB_INT_SIZE;
451 
452  /* Only process empty at this level in the EXTENDED case */
453  if ( (variant & WKB_EXTENDED) && lwgeom_is_empty((LWGEOM*)line) )
454  return empty_to_wkb_size((LWGEOM*)line, variant);
455 
456  /* Extended WKB needs space for optional SRID integer */
457  if ( lwgeom_wkb_needs_srid((LWGEOM*)line, variant) )
458  size += WKB_INT_SIZE;
459 
460  /* Size of point array */
461  size += ptarray_to_wkb_size(line->points, variant);
462  return size;
463 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:49
#define WKB_INT_SIZE
#define WKB_BYTE_SIZE
static size_t ptarray_to_wkb_size(const POINTARRAY *pa, uint8_t variant)
Definition: lwout_wkb.c:339
uint8_t variant
Definition: cu_in_twkb.c:26
#define WKB_EXTENDED
Definition: liblwgeom.h:1932
static size_t empty_to_wkb_size(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:277
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1297
POINTARRAY * points
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: