PostGIS  2.3.7dev-r@@SVN_REVISION@@
static void test_lwgeom_segmentize_sphere ( void  )
static

Definition at line 1518 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().

1519 {
1520  LWGEOM *lwg1, *lwg2;
1521  LWLINE *lwl;
1522  double max = 100000.0 / WGS84_RADIUS;
1523  //char *wkt;
1524 
1525  /* Simple case */
1526  lwg1 = lwgeom_from_wkt("LINESTRING(0 20, 5 20)", LW_PARSER_CHECK_NONE);
1527  lwg2 = lwgeom_segmentize_sphere(lwg1, max);
1528  lwl = (LWLINE*)lwg2;
1529  // printf("%s\n", lwgeom_to_ewkt(lwg2));
1530  CU_ASSERT_EQUAL(lwl->points->npoints, 9);
1531  lwgeom_free(lwg1);
1532  lwgeom_free(lwg2);
1533  //lwfree(wkt);
1534 
1535  return;
1536 }
#define WGS84_RADIUS
Definition: liblwgeom.h:130
int npoints
Definition: liblwgeom.h:370
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1985
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:1650
POINTARRAY * points
Definition: liblwgeom.h:421

Here is the call graph for this function:

Here is the caller graph for this function: