PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_lwline_from_lwmpoint()

static void test_lwline_from_lwmpoint ( void  )
static

Definition at line 1009 of file cu_gserialized1.c.

1010{
1011 LWLINE *line;
1012 LWMPOINT *mpoint;
1013
1014 mpoint = (LWMPOINT*)lwgeom_from_wkt("MULTIPOINT(0 0, 0 1, 1 1, 1 2, 2 2)", LW_PARSER_CHECK_NONE);
1015 line = lwline_from_lwmpoint(SRID_DEFAULT, mpoint);
1016 CU_ASSERT_EQUAL(line->points->npoints, mpoint->ngeoms);
1017 CU_ASSERT_DOUBLE_EQUAL(lwline_length_2d(line), 4.0, 0.000001);
1018
1019 lwline_free(line);
1020 lwmpoint_free(mpoint);
1021}
void lwmpoint_free(LWMPOINT *mpt)
Definition lwmpoint.c:72
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
#define SRID_DEFAULT
Definition liblwgeom.h:225
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940
void lwline_free(LWLINE *line)
Definition lwline.c:67
LWLINE * lwline_from_lwmpoint(int32_t srid, const LWMPOINT *mpoint)
Definition lwline.c:285
double lwline_length_2d(const LWLINE *line)
Definition lwline.c:530
POINTARRAY * points
Definition liblwgeom.h:483
uint32_t ngeoms
Definition liblwgeom.h:538
uint32_t npoints
Definition liblwgeom.h:427

References LW_PARSER_CHECK_NONE, lwgeom_from_wkt(), lwline_free(), lwline_from_lwmpoint(), lwline_length_2d(), lwmpoint_free(), LWMPOINT::ngeoms, POINTARRAY::npoints, LWLINE::points, and SRID_DEFAULT.

Referenced by gserialized1_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: