Distance
Calculate the distance between two geometries in meters.Request Body
number
required
Target chain ID. All UIDs must exist on this chain.
Input
required
First geometry. Can be a UID, GeoJSON, or offchain attestation reference.
Input
required
Second geometry. Can be a UID, GeoJSON, or offchain attestation reference.
string
required
EAS schema UID to issue the attestation against.
string
Ethereum address to receive the attestation. Defaults to zero address if not provided.
Example Request
Response
number
required
Distance in meters (e.g., 523.45)
string
required
Always “meters”
string
required
Always “distance”
number
required
Unix timestamp of computation
string[]
required
Array of input references (UIDs or geometry hashes)
object
required
The signed attestation object
object
required
Signature for delegated onchain submission
Example Response
Notes
- Distance is calculated using PostGIS
ST_Distancewith geodetic coordinates - Result is in meters with centimeter precision (rounded to 0.01m)
- For raw GeoJSON inputs, a keccak256 hash is used in
inputRefs
SDK Method
See
astral.compute.distance()