PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_lwgeom_segmentize_sphere()

static void test_lwgeom_segmentize_sphere ( void  )
static

Definition at line 1524 of file cu_geodetic.c.

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

1525 {
1526  LWGEOM *lwg1, *lwg2;
1527  LWLINE *lwl;
1528  double max = 100000.0 / WGS84_RADIUS;
1529  //char *wkt;
1530 
1531  /* Simple case */
1532  lwg1 = lwgeom_from_wkt("LINESTRING(0 20, 5 20)", LW_PARSER_CHECK_NONE);
1533  lwg2 = lwgeom_segmentize_sphere(lwg1, max);
1534  lwl = (LWLINE*)lwg2;
1535  // printf("%s\n", lwgeom_to_ewkt(lwg2));
1536  CU_ASSERT_EQUAL(lwl->points->npoints, 9);
1537  lwgeom_free(lwg1);
1538  lwgeom_free(lwg2);
1539  //lwfree(wkt);
1540 
1541  return;
1542 }
#define WGS84_RADIUS
Definition: liblwgeom.h:131
int npoints
Definition: liblwgeom.h:371
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2013
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:1739
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: