PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_lwgeom_segmentize_sphere()

static void test_lwgeom_segmentize_sphere ( void  )
static

Definition at line 1541 of file cu_geodetic.c.

1542 {
1543  LWGEOM *lwg1, *lwg2;
1544  LWLINE *lwl;
1545  double max = 100000.0 / WGS84_RADIUS;
1546  //char *wkt;
1547 
1548  /* Simple case */
1549  lwg1 = lwgeom_from_wkt("LINESTRING(0 20, 5 20)", LW_PARSER_CHECK_NONE);
1550  lwg2 = lwgeom_segmentize_sphere(lwg1, max);
1551  lwl = (LWLINE*)lwg2;
1552  // printf("%s\n", lwgeom_to_ewkt(lwg2));
1553  CU_ASSERT_EQUAL(lwl->points->npoints, 9);
1554  lwgeom_free(lwg1);
1555  lwgeom_free(lwg2);
1556  //lwfree(wkt);
1557 
1558  return;
1559 }
LWGEOM * lwgeom_segmentize_sphere(const LWGEOM *lwg_in, double max_seg_length)
Derive a new geometry with vertices added to ensure no vertex is more than max_seg_length (in radians...
Definition: lwgeodetic.c:1743
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2060
#define WGS84_RADIUS
Definition: liblwgeom.h:162
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:905
POINTARRAY * points
Definition: liblwgeom.h:469
uint32_t npoints
Definition: liblwgeom.h:413

References LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), lwgeom_segmentize_sphere(), POINTARRAY::npoints, LWLINE::points, and WGS84_RADIUS.

Referenced by geodetic_suite_setup().

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