TRIANGLE Read a WKB triangle, starting just after the endian byte, type number and optional srid number.
Advance the parse state forward appropriately. Triangles are encoded like polygons in WKB, but more like linestrings as lwgeometries.
Definition at line 599 of file lwin_wkb.c.
600{
603 return NULL;
606
607
608 if( nrings == 0 )
609 return tri;
610
611
612 if ( nrings != 1 )
613 lwerror(
"Triangle has wrong number of rings: %d", nrings);
614
615
617
618
619 if( pa == NULL )
620 return tri;
621
622
624 {
627 return NULL;
628 }
629
631 {
633 return NULL;
634 }
635
636
639
641 return tri;
642}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define LW_PARSER_CHECK_ZCLOSURE
LWTRIANGLE * lwtriangle_construct_empty(int32_t srid, char hasz, char hasm)
int ptarray_is_closed_z(const POINTARRAY *pa)
#define LW_PARSER_CHECK_MINPOINTS
Parser check flags.
void ptarray_free(POINTARRAY *pa)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
static POINTARRAY * ptarray_from_wkb_state(wkb_parse_state *s)
POINTARRAY Read a dynamically sized point array and advance the parse state forward.
References integer_from_wkb_state(), LW_PARSER_CHECK_MINPOINTS, LW_PARSER_CHECK_ZCLOSURE, LWDEBUGF, lwerror(), lwtriangle_construct_empty(), lwtype_name(), POINTARRAY::npoints, LWTRIANGLE::points, ptarray_free(), ptarray_from_wkb_state(), ptarray_is_closed_z(), and s.
Referenced by lwgeom_from_wkb_state().