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

◆ test_force_3dz()

static void test_force_3dz ( void  )
static

Definition at line 67 of file cu_force_dims.c.

68{
69 LWGEOM *geom;
70 LWGEOM *geom3dz;
71 char *wkt_out;
72
73 geom = lwgeom_from_wkt("CIRCULARSTRING(-5 0,0 5,5 0,10 -5,15 0)", LW_PARSER_CHECK_NONE);
74 geom3dz = lwgeom_force_3dz(geom, -99);
75 wkt_out = lwgeom_to_ewkt(geom3dz);
76 ASSERT_STRING_EQUAL("CIRCULARSTRING(-5 0 -99,0 5 -99,5 0 -99,10 -5 -99,15 0 -99)", wkt_out);
77 lwgeom_free(geom);
78 lwgeom_free(geom3dz);
79 lwfree(wkt_out);
80
81 geom = lwgeom_from_wkt("CIRCULARSTRING(-5 0,0 5,5 0,10 -5,15 0)", LW_PARSER_CHECK_NONE);
82 geom3dz = lwgeom_force_3dz(geom, 0.0);
83 wkt_out = lwgeom_to_ewkt(geom3dz);
84 ASSERT_STRING_EQUAL("CIRCULARSTRING(-5 0 0,0 5 0,5 0 0,10 -5 0,15 0 0)", wkt_out);
85 lwgeom_free(geom);
86 lwgeom_free(geom3dz);
87 lwfree(wkt_out);
88}
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
LWGEOM * lwgeom_force_3dz(const LWGEOM *geom, double zval)
Definition lwgeom.c:827
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an allocated string.
Definition lwgeom.c:593
void lwfree(void *mem)
Definition lwutil.c:248
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940

References ASSERT_STRING_EQUAL, LW_PARSER_CHECK_NONE, lwfree(), lwgeom_force_3dz(), lwgeom_free(), lwgeom_from_wkt(), and lwgeom_to_ewkt().

Referenced by force_dims_suite_setup().

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