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

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

1447 {
1448  LWGEOM *lwg1, *lwg2;
1449  LWLINE *lwl;
1450  double max = 100000.0 / WGS84_RADIUS;
1451  //char *wkt;
1452 
1453  /* Simple case */
1454  lwg1 = lwgeom_from_wkt("LINESTRING(0 20, 5 20)", LW_PARSER_CHECK_NONE);
1455  lwg2 = lwgeom_segmentize_sphere(lwg1, max);
1456  lwl = (LWLINE*)lwg2;
1457  //wkt = lwgeom_to_ewkt(lwg2);
1458  CU_ASSERT_EQUAL(lwl->points->npoints, 7);
1459  lwgeom_free(lwg1);
1460  lwgeom_free(lwg2);
1461  //lwfree(wkt);
1462 
1463  return;
1464 }
#define WGS84_RADIUS
Definition: liblwgeom.h:98
int npoints
Definition: liblwgeom.h:327
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
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:1638
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: