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_DWithin to filter candidates
  • use ST_Distance to compute the returned distance value

Core rules

  • Units depend on type:
    • geometry → SRID units (degrees/meters/feet depending on SRID)
    • geographymeters
  • Geometries must be in the same SRID for geometry math
  • Do not compute meaningful distances in EPSG:4326 geometry (degrees) unless you intend degrees

Canonical patterns

Related skills
Installs
9
First Seen
Feb 9, 2026