Save a scene: what the globe shows (SP6.b)
curl --request POST \
--url https://api.eddy.engineer/v1/spatial.scene \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"document": {}
}'import requests
url = "https://api.eddy.engineer/v1/spatial.scene"
payload = { "document": {} }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document: {}})
};
fetch('https://api.eddy.engineer/v1/spatial.scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/spatial.scene",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/spatial.scene"
payload := strings.NewReader("{\n \"document\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/spatial.scene")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/spatial.scene")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {}\n}"
response = http.request(request)
puts response.read_body{
"camera": {},
"id": "<string>",
"key": "<string>",
"keys": [
"<string>"
],
"kinds": {},
"layers": 123,
"name": "<string>",
"source": {}
}Maps
Save a scene: what the globe shows (SP6.b)
Canonicalises and stores a scene document (`ss.spatial.scene/1`): the layers by content address — `kind` raster | vector | volumes | roadgraph | snapshot | mission | tiles, the `key`, a name, `visible`, an optional `style` object — an optional `camera` {lon, lat, height, heading, pitch} and `notes`. The scene names documents and never contains them; it is the document the `/spatial` page's collaboration shell edits live through the `globe` family (RFC 6902 JSON Patch, every result validated by these rules). Refuses typed: a repeated or empty layer id, an unknown kind, a key that is not a content address, a camera off the globe, more than 256 layers. UD14: a layer's `style.colour` is typed and validated with the scene (STYLE, naming the layer): {kind: graduated, by, breaks, colours, null_colour?, label?, unit?} colours by a numeric property through stated, strictly increasing breaks (n breaks make n + 1 classes; a value's class is the count of breaks ≤ it; one colour per class), or {kind: categorical, by, categories: [{value, colour, label?}], other_colour?, null_colour?} colours by a property's value. Colours are #rrggbb or #rrggbbaa. The rule styles vector and tiles layers; on a time-indexed layer `by` may be a series and the step shown is the one classed. The legend follows from the rule. The rest of `style` stays free.
POST
/
v1
/
spatial.scene
Save a scene: what the globe shows (SP6.b)
curl --request POST \
--url https://api.eddy.engineer/v1/spatial.scene \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"document": {}
}'import requests
url = "https://api.eddy.engineer/v1/spatial.scene"
payload = { "document": {} }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document: {}})
};
fetch('https://api.eddy.engineer/v1/spatial.scene', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/spatial.scene",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'document' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/spatial.scene"
payload := strings.NewReader("{\n \"document\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/spatial.scene")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/spatial.scene")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {}\n}"
response = http.request(request)
puts response.read_body{
"camera": {},
"id": "<string>",
"key": "<string>",
"keys": [
"<string>"
],
"kinds": {},
"layers": 123,
"name": "<string>",
"source": {}
}