PostGIS  2.1.10dev-r@@SVN_REVISION@@
static uint8_t* empty_to_wkb_buf ( const LWGEOM geom,
uint8_t *  buf,
uint8_t  variant 
)
static

Definition at line 285 of file lwout_wkb.c.

References endian_to_wkb_buf(), integer_to_wkb_buf(), lwgeom_wkb_needs_srid(), lwgeom_wkb_type(), POINTTYPE, LWGEOM::srid, LWGEOM::type, WKB_MULTIPOINT_TYPE, and WKB_POINT_TYPE.

Referenced by lwgeom_to_wkb_buf().

286 {
287  uint32_t wkb_type = lwgeom_wkb_type(geom, variant);
288 
289  if ( geom->type == POINTTYPE )
290  {
291  /* Change POINT to MULTIPOINT */
292  wkb_type &= ~WKB_POINT_TYPE; /* clear POINT flag */
293  wkb_type |= WKB_MULTIPOINT_TYPE; /* set MULTIPOINT flag */
294  }
295 
296  /* Set the endian flag */
297  buf = endian_to_wkb_buf(buf, variant);
298 
299  /* Set the geometry type */
300  buf = integer_to_wkb_buf(wkb_type, buf, variant);
301 
302  /* Set the SRID if necessary */
303  if ( lwgeom_wkb_needs_srid(geom, variant) )
304  buf = integer_to_wkb_buf(geom->srid, buf, variant);
305 
306  /* Set nrings/npoints/ngeoms to zero */
307  buf = integer_to_wkb_buf(0, buf, variant);
308  return buf;
309 }
static int lwgeom_wkb_needs_srid(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:47
static uint32_t lwgeom_wkb_type(const LWGEOM *geom, uint8_t variant)
Definition: lwout_wkb.c:66
int32_t srid
Definition: liblwgeom.h:355
static uint8_t * integer_to_wkb_buf(const int ival, uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:180
#define WKB_POINT_TYPE
Well-Known Binary (WKB) Geometry Types.
#define WKB_MULTIPOINT_TYPE
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
static uint8_t * endian_to_wkb_buf(uint8_t *buf, uint8_t variant)
Definition: lwout_wkb.c:148

Here is the call graph for this function:

Here is the caller graph for this function: