PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ line2pts()

static void line2pts ( const char *  wkt,
POINT3D A1,
POINT3D A2 
)
static

Definition at line 561 of file cu_geodetic.c.

562 {
564  POINTARRAY *pa;
565  POINT2D p1, p2;
566  GEOGRAPHIC_POINT g1, g2;
567  if ( ! l )
568  {
569  printf("BAD WKT FOUND in test_edge_intersects:\n %s\n\n", wkt);
570  exit(0);
571  }
572  pa = l->points;
573  getPoint2d_p(pa, 0, &p1);
574  getPoint2d_p(pa, 1, &p2);
575  geographic_point_init(p1.x, p1.y, &g1);
576  geographic_point_init(p2.x, p2.y, &g2);
577  geog2cart(&g1, A1);
578  geog2cart(&g2, A2);
579  lwline_free(l);
580  return;
581 }
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2005
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition: lwgeom_api.c:348
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
void lwline_free(LWLINE *line)
Definition: lwline.c:76
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition: lwgeodetic.c:180
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesian coordinates on unit sphere.
Definition: lwgeodetic.c:404
Point in spherical coordinates on the world.
Definition: lwgeodetic.h:53
POINTARRAY * points
Definition: liblwgeom.h:425
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331

References geog2cart(), geographic_point_init(), getPoint2d_p(), LW_PARSER_CHECK_NONE, lwgeom_from_wkt(), lwline_free(), LWLINE::points, POINT2D::x, and POINT2D::y.

Referenced by test_edge_intersects().

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