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), 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 }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.
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.

