Api session event editor netload import

From Tygron Support wiki
Revision as of 14:52, 11 November 2026 by Frank@tygron.nl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

API Endpoint: api/session/event/editornetload/import/

Description: Import a Collection of Net Load geometries, names, Net Types, Net state, to an existing Net by adding Net Lines with the provided Net Function. A Building is assigned to a Net Load when within Building range. A Net Load is assigned to a Net Node when within Net Node range

Index Importance Type Description Values
0 REQUIRED (GeometryCollection with crs: EPSG:3857) Net Load Geometries
1 REQUIRED (String or multiple values in array ["a", "b", "c"]) Names
2 REQUIRED (NetType or multiple values in array [a, b, c]) Net Types
3 REQUIRED (TimeState or multiple values in array [a, b, c]) Net state
4 REQUIRED (String or multiple values in array ["a", "b", "c"]) Concateneted Addresses
5 REQUIRED (String or multiple values in array ["a", "b", "c"]) Attributes
6 REQUIRED (Floating point number or multiple values in array [1.0, 2.0, 3.0] or matrix [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]) Attribute Values array
7 REQUIRED (Integer number) Index of Root Load Geometry
8 REQUIRED (Floating point number) Building Range
9 REQUIRED (Floating point number) Net Node Range
10 REQUIRED (SOURCE Integer ID) Source

Response Codes

Response Code: Description
204 No Content
300-600 Codes Overview

Example POST

Curl example POST

curl 'https://engine.tygron.com/api/session/event/editornetload/import/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ {
 "type" : "GeometryCollection",
 "geometries" : [ {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
 } ]
}, "Name 1", "ELECTRICITY", "NOTHING", "Concateneted Addresse 1", "Attribute 1", [ 1.0, 2.0 ], 1, 51, 32, 1 ]
'

Curl example multi item POST

curl 'https://engine.tygron.com/api/session/event/editornetload/import/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ {
 "type" : "GeometryCollection",
 "geometries" : [ {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
 }, {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658646.762, 6799451.896 ], [ 658646.762, 6799461.896 ], [ 658656.762, 6799461.896 ], [ 658656.762, 6799451.896 ], [ 658646.762, 6799451.896 ] ] ] ]
 }, {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658656.762, 6799451.896 ], [ 658656.762, 6799461.896 ], [ 658666.762, 6799461.896 ], [ 658666.762, 6799451.896 ], [ 658656.762, 6799451.896 ] ] ] ]
 } ]
}, [ "Name 1", "Name 2", "Name 3" ], [ "ELECTRICITY", "GAS", "HEAT" ], [ "NOTHING", "WAITING_FOR_DATE", "REQUEST_PLOT_OWNER_APPROVAL" ], [ "Concateneted Addresse 1", "Concateneted Addresse 2", "Concateneted Addresse 3" ], [ "Attribute 1", "Attribute 2", "Attribute 3" ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ], 1, 32, 36, 1 ]
'

JavaScript example POST

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ { "type" : "GeometryCollection", "geometries" : [ { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ] } ]}, "Name 1", "ELECTRICITY", "NOTHING", "Concateneted Addresse 1", "Attribute 1", [ 1.0, 2.0 ], 1, 51, 32, 1 ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetload/import/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));