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 603 of file lwin_wkb.c.
604{
607 return NULL;
608
609
610 if( nrings == 0 )
612
613
614 if (nrings != 1)
615 {
616 lwerror(
"Triangle has wrong number of rings: %d", nrings);
617 }
618
619
621
622
623 if (pa == NULL)
625
626
628 {
631 return NULL;
632 }
633
635 {
638 return NULL;
639 }
640
641
643}
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)
LWTRIANGLE * lwtriangle_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
void void lwerror(const char *fmt,...) __attribute__((format(printf
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, lwerror(), lwtriangle_construct(), lwtriangle_construct_empty(), lwtype_name(), POINTARRAY::npoints, ptarray_free(), ptarray_from_wkb_state(), ptarray_is_closed_z(), and s.
Referenced by lwgeom_from_wkb_state().