Geodesic distance between two geometries, in meters. Mirrors ash_geo /
PostGIS ST_Distance. Post #274 every geometry arrives as a
%Geo.*{} struct.
Place
|> Ash.Query.filter(st_distance(location, ^customer_point) < 5_000)
|> Ash.read!()When used inside a comparison filter (<, <=, >, >=, ==,
!=) against a Point attribute, the whole comparison pushes down to
Neo4j's native point.distance(p1, p2) <op> threshold (geodesic
haversine in WGS-84) via the <attr>.point indexable companion.
In-memory coverage (#279)
Any geometry to a Point is supported and exact at this scale:
- Point — geodesic haversine.
- LineString / MultiLineString — true closest-point-on-segment (not closest-vertex), so a point near a long edge's midpoint reads its real perpendicular distance rather than the overstated distance to the nearest vertex.
- MultiPoint — distance to the nearest point of the set.
- Polygon / MultiPolygon —
0.0when the point is inside (hole-aware viatopo), otherwise the distance to the nearest boundary edge (over the exterior ring and any holes).
Distances between two non-Point geometries (line↔line,
line↔polygon, polygon↔polygon) need segment-to-segment math and stay
:unknown for now — deferred in #279.
Summary
Functions
Callback implementation for Ash.Query.Function.args/0.