Skip to main content
Research Preview — This API is under development.

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. See Input types for accepted formats.
Input
required
Second geometry.
string
EAS schema UID. The server uses a default schema if not provided.
string
Ethereum address to receive the attestation. Defaults to the zero address.

Example request

Response

Returns a NumericComputeResponse.
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).
AttestationData
required
Signed EAS attestation. See AttestationData.
DelegatedAttestationData
required
Signature for delegated onchain submission. See DelegatedAttestationData.

Example response

Notes

  • Distance is calculated using PostGIS ST_Distance with geodetic coordinates
  • Result is in meters with centimeter precision
  • The onchain attested value is scaled to centimeters (integer) for EVM compatibility
  • For raw GeoJSON inputs, a keccak256 hash is used in inputRefs

SDK Method

See astral.compute.distance()