PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void line2pts ( const char *  wkt,
POINT3D A1,
POINT3D A2 
)
static

Definition at line 541 of file cu_geodetic.c.

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

542 {
544  POINTARRAY *pa;
545  POINT2D p1, p2;
546  GEOGRAPHIC_POINT g1, g2;
547  if ( ! l )
548  {
549  printf("BAD WKT FOUND in test_edge_intersects:\n %s\n\n", wkt);
550  exit(0);
551  }
552  pa = l->points;
553  getPoint2d_p(pa, 0, &p1);
554  getPoint2d_p(pa, 1, &p2);
555  geographic_point_init(p1.x, p1.y, &g1);
556  geographic_point_init(p2.x, p2.y, &g2);
557  geog2cart(&g1, A1);
558  geog2cart(&g2, A2);
559  lwline_free(l);
560  return;
561 }
void lwline_free(LWLINE *line)
Definition: lwline.c:63
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
Point in spherical coordinates on the world.
Definition: lwgeodetic.h:33
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
double x
Definition: liblwgeom.h:284
double y
Definition: liblwgeom.h:284
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:434
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
Convert spherical coordinates to cartesion coordinates on unit sphere.
Definition: lwgeodetic.c:355
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
Definition: lwgeodetic.c:157
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: