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

◆ test_lwline_clip_big()

static void test_lwline_clip_big ( void  )
static

Definition at line 890 of file cu_algorithm.c.

891{
892 POINTARRAY *pa = ptarray_construct(1, 0, 3);
893 LWGEOM *line = (LWGEOM *)lwline_construct(SRID_UNKNOWN, NULL, pa);
894 LWCOLLECTION *c;
895 char *ewkt;
896 POINT4D p;
897
898 p.x = 0.0;
899 p.y = 0.0;
900 p.z = 0.0;
901 ptarray_set_point4d(pa, 0, &p);
902
903 p.x = 1.0;
904 p.y = 1.0;
905 p.z = 1.0;
906 ptarray_set_point4d(pa, 1, &p);
907
908 p.x = 2.0;
909 p.y = 2.0;
910 p.z = 2.0;
911 ptarray_set_point4d(pa, 2, &p);
912
913 c = lwgeom_clip_to_ordinate_range(line, 'Z', 0.5, 1.5, 0);
914 ewkt = lwgeom_to_ewkt((LWGEOM*)c);
915 //printf("c = %s\n", ewkt);
916 ASSERT_STRING_EQUAL(ewkt, "MULTILINESTRING((0.5 0.5 0.5,1 1 1,1.5 1.5 1.5))");
917
918 lwfree(ewkt);
920 lwgeom_free(line);
921}
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
LWCOLLECTION * lwgeom_clip_to_ordinate_range(const LWGEOM *lwin, char ordinate, double from, double to, double offset)
Given a geometry clip based on the from/to range of one of its ordinates (x, y, z,...
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an allocated string.
Definition lwgeom.c:593
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
Definition lwline.c:42
void lwfree(void *mem)
Definition lwutil.c:248
void lwcollection_free(LWCOLLECTION *col)
#define SRID_UNKNOWN
Unknown SRID value.
Definition liblwgeom.h:215
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition lwgeom_api.c:369
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
Definition ptarray.c:51
double x
Definition liblwgeom.h:414
double z
Definition liblwgeom.h:414
double y
Definition liblwgeom.h:414

References ASSERT_STRING_EQUAL, lwcollection_free(), lwfree(), lwgeom_clip_to_ordinate_range(), lwgeom_free(), lwgeom_to_ewkt(), lwline_construct(), ptarray_construct(), ptarray_set_point4d(), SRID_UNKNOWN, POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by algorithms_suite_setup().

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