PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ _lwt_describe_intersection_point()

static bool _lwt_describe_intersection_point ( const GEOSGeometry *  g1,
const GEOSGeometry *  g2,
char *  buf,
size_t  bufsize 
)
static

Definition at line 47 of file lwgeom_topo.c.

48{
49 unsigned int n = 0;
50 POINT2D pt;
51 GEOSGeometry *isect;
52 GEOSGeometry *surface_pt;
53 const GEOSCoordSequence *seq;
54
55 isect = GEOSIntersection(g1, g2);
56 if (!isect)
57 return false;
58
59 surface_pt = GEOSPointOnSurface(isect);
60 GEOSGeom_destroy(isect);
61 if (!surface_pt)
62 return false;
63
64 seq = GEOSGeom_getCoordSeq(surface_pt);
65 if (!seq)
66 {
67 GEOSGeom_destroy(surface_pt);
68 return false;
69 }
70
71 if (!GEOSCoordSeq_getSize(seq, &n) || !n)
72 {
73 GEOSGeom_destroy(surface_pt);
74 return false;
75 }
76
77 if (!GEOSCoordSeq_getX(seq, 0, &pt.x) || !GEOSCoordSeq_getY(seq, 0, &pt.y))
78 {
79 GEOSGeom_destroy(surface_pt);
80 return false;
81 }
82
83 GEOSGeom_destroy(surface_pt);
84 snprintf(buf, bufsize, " at POINT(%.15g %.15g)", pt.x, pt.y);
85 return true;
86}
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390

References POINT2D::x, and POINT2D::y.

Referenced by _lwt_CheckEdgeCrossing().

Here is the caller graph for this function: