Get a terrain upload URL
presign_terrain_uploadGenerate a presigned S3 PUT URL for uploading a GeoTIFF DEM, enabling the first step of terrain import before finalization.
Instructions
Step 1 of a terrain import: get a presigned S3 PUT URL for a GeoTIFF DEM.
Only for a client that has a shell and an agent key AND a DEM no platform source covers. A connector agent with no shell (claude.ai) uses list_terrain_sources then create_terrain_from_source instead, or asks the user to upload their own DEM in the map.
The import needs a launch-level agent key: a draft key can presign, but finalize_terrain_upload (and the multipart fallback below) answer a read or draft key 403 AGENT_LEVEL_INSUFFICIENT — check the key before moving bytes.
The agent moves the bytes itself — no tool accepts file contents. After this
call, PUT the file straight to upload_url, sending the SAME Content-Type
you passed here (it is part of the signature; a mismatch is a 403
SignatureDoesNotMatch before it is anything else):
curl -sS -X PUT -H "Content-Type: image/tiff" --upload-file /path/dem.tif "$UPLOAD_URL"then call finalize_terrain_upload with the returned staging_key and
process_id. Nothing exists in Hydrata until finalize; the URL expires after
expires_in seconds (3600).
Platform guidance: keep the terrain extent within 5° across and 40,000 km²
(200 × 200 km). The API enforces that cap on its bbox-fetch path; an
uploaded GeoTIFF is only rejected above 5 GiB, but a larger DEM will not
mesh or run well. The GeoTIFF must carry a CRS; the import reprojects it to
the site's UTM zone and builds a hillshade. Fallback when a presigned PUT is
impossible: multipart-POST the file with the same agent key to
/api/v2/anuga/projects//terrain/upload/ (form field file, optional
title), which creates the terrain in one step — then get_terrain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | File size in bytes (`stat -c %s <file>`). The API rejects > 5 GiB up front. Omit if unknown. | |
| filename | Yes | Base name of the GeoTIFF, e.g. 'dem.tif' (a name only — never contents) | |
| project_id | Yes | The project ID | |
| content_type | No | MIME type the PUT will send (default 'image/tiff'). It is SIGNED into the URL, so the PUT must send exactly this Content-Type header. | image/tiff |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||