Layers & Uploads
Upload a layer file
Section titled “Upload a layer file”POST /api/layers/upload (token permission: upload)Content-Type: multipart/form-dataFields: roomName, layerName, file, and optional description, style (JSON: color, opacity,
strokeWeight, visible, and attributeDisplay), display (JSON, for
rasters). Behavior by content:
- Point GeoJSON/CSV → markers (
{ markersCreated, markers, layer: null }) - Polygon / line → a vector layer (
{ layer: { name, featureCount, ... } }) - GeoTIFF → a raster layer
- Larger vector inputs return
{ jobId }— poll the job (below).
curl -X POST "$API/api/layers/upload" -H "Authorization: Bearer $TOKEN" \ -F "roomName=$ROOM" -F "layerName=my-layer" -F "file=@data/my-layer.geojson"Create a layer from inline GeoJSON
Section titled “Create a layer from inline GeoJSON”POST /api/rooms/:roomId/layers (token permission: write)Content-Type: application/json{ "name": "drawn", "description": "study area", "geojson": { "type": "FeatureCollection", "features": [] }, "color": "e11d48", "opacity": 0.35, "strokeWeight": 3, "visible": true }An optional attributeDisplay field sets the layer’s popup values, raster rows, colors by attribute and
filters (below).
Set a layer’s attribute display
Section titled “Set a layer’s attribute display”PATCH /api/layers/:layerId (token permission: write)Content-Type: application/json{ "attributeDisplay": { "version": 1, "popup": { "mode": "auto" } } }The attribute display says which values a feature’s popup shows,
which values of the room’s raster layers it reads under the feature (rasters), how the layer is colored
by an attribute, and which range filters the legend offers. The PATCH writes it to the live map and
records a timeline entry. It replaces the whole setting, so send every part you want to keep;
"attributeDisplay": null removes it. Uploads and inline creates check style.attributeDisplay /
attributeDisplay the same way before anything is stored.
A PATCH needs a layer stored on the server (404 otherwise). A layer of 100 features or fewer is kept in
the room like a drawn shape, so it takes its attribute display only when it is uploaded, created or
imported.
A malformed value is refused, and nothing changes:
{ "error": "invalid_attribute_display", "details": ["classification.breaks_not_increasing", "classification.colors_length"] }List layers
Section titled “List layers”GET /api/layers/:roomName (token permission: read)→ { "layers": [ { "id", "name", "featureCount", ... } ] }
Fetch features by bounding box
Section titled “Fetch features by bounding box”GET /api/layers/:layerId/features?minLon=&minLat=&maxLon=&maxLat=&zoom=Returns a GeoJSON FeatureCollection. Small layers stream a complete object with
_metadata.complete = true; very large ones may return a chunk manifest (_metadata.directChunks) whose
path values you fetch and merge:
GET /api/layers/:layerId/features/chunks/:chunkIndexLarge files: chunked upload
Section titled “Large files: chunked upload”POST /api/layers/upload-chunk (token permission: upload)POST /api/layers/process-chunked (token permission: upload)Files over the 50 MB single-request cap are uploaded in chunks (the import script
does this for you), then assembled and processed. process-chunked takes the same layerName,
description and style as a single upload. A malformed style.attributeDisplay is refused while the
uploaded chunks are still kept, so you can fix it and send the same request again.
Poll a processing job
Section titled “Poll a processing job”GET /api/layers/jobs/:jobIdPoll until stage/status is terminal (complete or error):
{ "stage": "processing", "progress": 60, "message": "…" }Delete a layer
Section titled “Delete a layer”DELETE /api/layers/:layerId (user session only)Deleting a layer is an owner/session operation — a room API token cannot delete layers.