curl --request POST \
--url https://api.eddy.engineer/v1/power.gis \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"gismap": {},
"layers": {},
"include_document": true
}
'import requests
url = "https://api.eddy.engineer/v1/power.gis"
payload = {
"gismap": {},
"layers": {},
"include_document": True
}
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({gismap: {}, layers: {}, include_document: true})
};
fetch('https://api.eddy.engineer/v1/power.gis', 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/power.gis",
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([
'gismap' => [
],
'layers' => [
],
'include_document' => true
]),
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/power.gis"
payload := strings.NewReader("{\n \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\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/power.gis")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.gis")
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 \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Build a located network from a customer's GIS layers and an attribute map (`ss.power.gismap/1`)
UD15: vector layers (ss.spatial.vector/1, from spatial_vector_import, a shapefile or GeoPackage import, or inline) and an attribute map (which layer is lines, switches, transformers, loads, sources, shunts or named nodes; which attribute holds each network field; the line and transformer type tables the codes point into; snap.tolerance_m, stated, never defaulted) are built into ss.power.network/1: line ends and points within the tolerance are one bus, lengths are geodesic unless the map gives an attribute, every bus keeps its position and the network carries the build record (extensions.ud.gis: the frame, the map’s hash, the layers’ keys), so its results draw on the map. What the map gets wrong is a typed finding (a dangling end, an end short of a bus or mid-span, a loop in a radial feeder, a missing or unreadable attribute, an unknown type code): nothing is guessed, an element with missing data is left out and named. The network is stored as power_import stores one. Refused: POWER_GISMAP_INVALID (400), POWER_GIS_LAYER (422: a layer the map names not given or not valid), POWER_GIS_FRAME (422: layers in different frames, or one a feeder cannot be measured in), POWER_GIS_DOCUMENT (422), POWER_REQUEST (400).
curl --request POST \
--url https://api.eddy.engineer/v1/power.gis \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"gismap": {},
"layers": {},
"include_document": true
}
'import requests
url = "https://api.eddy.engineer/v1/power.gis"
payload = {
"gismap": {},
"layers": {},
"include_document": True
}
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({gismap: {}, layers: {}, include_document: true})
};
fetch('https://api.eddy.engineer/v1/power.gis', 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/power.gis",
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([
'gismap' => [
],
'layers' => [
],
'include_document' => true
]),
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/power.gis"
payload := strings.NewReader("{\n \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\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/power.gis")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.gis")
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 \"gismap\": {},\n \"layers\": {},\n \"include_document\": true\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
Response
As power_network (key, counts, validation, …) and layers (each layer's key), build (the build report's key, ss.power.gisbuild/1), report (frame, tolerance, buses, branches, line length, findings by code), gis_findings (the first 200) and gis_findings_count, document
The response is of type object.