postgis-distance
Installation
SKILL.md
ST_Distance (Numeric Distance)
Use this skill when you need the numeric distance value between geometries (for reporting, ranking display, metadata).
If you need a boolean “within X distance” filter, prefer ST_DWithin (faster). A common pattern is:
- use
ST_DWithinto filter candidates - use
ST_Distanceto compute the returned distance value
Core rules
- Units depend on type:
geometry→ SRID units (degrees/meters/feet depending on SRID)geography→ meters
- Geometries must be in the same SRID for geometry math
- Do not compute meaningful distances in EPSG:4326 geometry (degrees) unless you intend degrees