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

Length

Calculate the length of a line in meters.

Request body

number
required
Target chain ID (e.g., 84532 for Base Sepolia).
Input
required
The line geometry to measure. See Input types for accepted formats.
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
Length in meters (e.g., 2345.67).
string
required
Always "meters".
string
required
Always "length".
number
required
Unix timestamp of computation.
string[]
required
Array of input references.
AttestationData
required
Signed EAS attestation. See AttestationData.
DelegatedAttestationData
required
Signature for delegated onchain submission. See DelegatedAttestationData.

Example response

Notes

  • Uses PostGIS ST_Length with geodetic calculation
  • Result is in meters with centimeter precision
  • The onchain attested value is scaled to centimeters (integer) for EVM compatibility
  • Valid for LineString and MultiLineString geometries

SDK Method

See astral.compute.length()