PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void test_lwline_from_lwmpoint ( void  )
static

Definition at line 937 of file cu_libgeom.c.

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 libgeom_suite_setup().

938 {
939  LWLINE *line;
940  LWMPOINT *mpoint;
941 
942 // LWLINE *
943 // lwline_from_lwmpoint(int srid, LWMPOINT *mpoint)
944 
945  mpoint = (LWMPOINT*)lwgeom_from_wkt("MULTIPOINT(0 0, 0 1, 1 1, 1 2, 2 2)", LW_PARSER_CHECK_NONE);
946  line = lwline_from_lwmpoint(SRID_DEFAULT, mpoint);
947  CU_ASSERT_EQUAL(line->points->npoints, mpoint->ngeoms);
948  CU_ASSERT_DOUBLE_EQUAL(lwline_length_2d(line), 4.0, 0.000001);
949 
950  lwline_free(line);
951  lwmpoint_free(mpoint);
952 }
LWLINE * lwline_from_lwmpoint(int srid, LWMPOINT *mpoint)
Definition: lwline.c:260
int npoints
Definition: liblwgeom.h:327
void lwline_free(LWLINE *line)
Definition: lwline.c:63
#define SRID_DEFAULT
Definition: liblwgeom.h:161
double lwline_length_2d(const LWLINE *line)
Definition: lwline.c:503
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
void lwmpoint_free(LWMPOINT *mpt)
Definition: lwmpoint.c:59
int ngeoms
Definition: liblwgeom.h:424
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: