Skip to main content

Module edge

Module edge 

Source
Expand description

Low-level segment and edge geometry primitives.

Used by ST_Contains, ST_Intersects, and ST_Distance. All operations are planar (coordinate-space), not spherical. This is correct for the small-area geometries typical of spatial predicates (city blocks, not hemispheres). For large-area work, haversine handles the globe.

Enums§

Orientation
Orientation of three points (collinear, clockwise, counter-clockwise). Uses the cross product of vectors (p→q) and (p→r).

Functions§

on_segment
Whether point q lies on segment p-r (given that p, q, r are collinear).
orientation
Compute orientation of ordered triplet (p, q, r).
point_on_ring_boundary
Whether a point lies on any edge of a polygon ring.
point_on_segment
Whether a point lies exactly on a line segment (within epsilon tolerance).
point_to_segment_dist_sq
Minimum squared distance from a point to a line segment.
ring_edges
Extract all edges from a polygon ring as segment pairs.
segment_to_segment_dist_sq
Minimum squared distance between two line segments.
segments_intersect
Whether two segments (p1-q1) and (p2-q2) intersect.