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

Intersects

Check if two geometries intersect (share any portion of space).
POST /compute/v0/intersects

Request body

chainId
number
required
Target chain ID (e.g., 84532 for Base Sepolia).
geometry1
Input
required
First geometry to check. See Input types for accepted formats.
geometry2
Input
required
Second geometry to check.
schema
string
EAS schema UID. The server uses a default schema if not provided.
recipient
string
Ethereum address to receive the attestation. Defaults to the zero address.

Example request

curl -X POST https://api.astral.global/compute/v0/intersects \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "chainId": 84532,
    "geometry1": "0xpolygon1...",
    "geometry2": "0xpolygon2...",
    "recipient": "0xdef456..."
  }'

Response

Returns a BooleanComputeResponse.
result
boolean
required
true if the geometries share any space.
operation
string
required
Always "intersects".
timestamp
number
required
Unix timestamp of computation.
inputRefs
string[]
required
Array containing [geometry1Ref, geometry2Ref].
attestation
AttestationData
required
Signed EAS attestation. See AttestationData.
delegatedAttestation
DelegatedAttestationData
required
Signature for delegated onchain submission. See DelegatedAttestationData.

Example response

{
  "result": true,
  "operation": "intersects",
  "timestamp": 1706400000,
  "inputRefs": [
    "0xpolygon1...",
    "0xpolygon2..."
  ],
  "attestation": {
    "schema": "0x...",
    "attester": "0x590fdb53ed3f0B52694876d42367192a5336700F",
    "recipient": "0xdef456...",
    "data": "0x...",
    "revocable": true,
    "refUID": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "signature": "0x..."
  },
  "delegatedAttestation": {
    "signature": "0x...",
    "attester": "0x590fdb53ed3f0B52694876d42367192a5336700F",
    "deadline": 1706403600,
    "nonce": 0
  }
}

Notes

  • Uses PostGIS ST_Intersects function
  • Returns true if geometries share any space (including boundaries)
  • More permissive than contains — touching boundaries count as intersection

SDK Method

See astral.compute.intersects()