Api session event editor netload import: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
API Endpoint: api/session/event/editornetload/import/
API Endpoint: api/session/event/editornetload/import/


Description: Import multiple [[Net Load]]s
Description: Import a Collection of [[Net Load]] geometries, names, [[Net Type]]s, [[Net state]], to an existing Net by adding [[Net Line]]s 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


{|class=wikitable
{|class=wikitable
Line 13: Line 13:
| REQUIRED
| REQUIRED
| (GeometryCollection with crs: EPSG:3857)
| (GeometryCollection with crs: EPSG:3857)
| GeometryCollection
| [[Net Load]] Geometries
|  
|  
|-
|-
Line 19: Line 19:
| REQUIRED
| REQUIRED
| (String or multiple values in array ["a", "b", "c"])
| (String or multiple values in array ["a", "b", "c"])
| String[]
| Names
|  
|  
|-
|-
Line 25: Line 25:
| REQUIRED
| REQUIRED
| (NetType or multiple values in array [a, b, c])
| (NetType or multiple values in array [a, b, c])
| [[Net Type]][]
| [[Net Type]]s
|  
|  
|-
|-
Line 31: Line 31:
| REQUIRED
| REQUIRED
| (TimeState or multiple values in array [a, b, c])
| (TimeState or multiple values in array [a, b, c])
| [[Timestate]][]
| [[Net state]]
|  
|  
|-
|-
Line 37: Line 37:
| REQUIRED
| REQUIRED
| (String or multiple values in array ["a", "b", "c"])
| (String or multiple values in array ["a", "b", "c"])
| String[]
| Concateneted [[Address]]es
|  
|  
|-
|-
Line 43: Line 43:
| REQUIRED
| REQUIRED
| (String or multiple values in array ["a", "b", "c"])
| (String or multiple values in array ["a", "b", "c"])
| String[]
| [[Attribute]]s
|  
|  
|-
|-
Line 49: Line 49:
| REQUIRED
| 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]])
| (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]])
| double[][]
| [[Attribute]] Values array
|  
|  
|-
|-
Line 55: Line 55:
| REQUIRED
| REQUIRED
| (Integer number)
| (Integer number)
| Integer
| Index of Root Load Geometry
|  
|  
|-
|-
Line 61: Line 61:
| REQUIRED
| REQUIRED
| (Floating point number)
| (Floating point number)
| Double
| [[Building]] Range
|  
|  
|-
|-
Line 67: Line 67:
| REQUIRED
| REQUIRED
| (Floating point number)
| (Floating point number)
| Double
| [[Net Node]] Range
|  
|  
|-
|-
Line 73: Line 73:
| REQUIRED
| REQUIRED
| (SOURCE Integer ID)
| (SOURCE Integer ID)
| [[Source]]s
| [[Source]]
|  
|  
|}
|}
Line 96: Line 96:
  "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
  "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
  } ]
  } ]
}, "Text 1", "ELECTRICITY", "NOTHING", "Text 1", "Text 1", [ 1.0, 2.0 ], 1, 35, 91, 1 ]
}, "Name 1", "ELECTRICITY", "NOTHING", "Concateneted Addresse 1", "Attribute 1", [ 1.0, 2.0 ], 1, 51, 32, 1 ]
'
'
</syntaxhighlight>
</syntaxhighlight>
Line 113: Line 113:
  "coordinates" : [ [ [ [ 658656.762, 6799451.896 ], [ 658656.762, 6799461.896 ], [ 658666.762, 6799461.896 ], [ 658666.762, 6799451.896 ], [ 658656.762, 6799451.896 ] ] ] ]
  "coordinates" : [ [ [ [ 658656.762, 6799451.896 ], [ 658656.762, 6799461.896 ], [ 658666.762, 6799461.896 ], [ 658666.762, 6799451.896 ], [ 658656.762, 6799451.896 ] ] ] ]
  } ]
  } ]
}, [ "Text 1", "Text 2", "Text 3" ], [ "ELECTRICITY", "GAS", "HEAT" ], [ "NOTHING", "WAITING_FOR_DATE", "REQUEST_PLOT_OWNER_APPROVAL" ], [ "Text 1", "Text 2", "Text 3" ], [ "Text 1", "Text 2", "Text 3" ], [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ], 1, 77, 47, 1 ]
}, [ "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 ]
'
'
</syntaxhighlight>
</syntaxhighlight>
Line 120: Line 120:
 method: "POST",
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 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 ] ] ] ] } ]}, "Text 1", "ELECTRICITY", "NOTHING", "Text 1", "Text 1", [ 1.0, 2.0 ], 1, 35, 91, 1 ]'
 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)
fetch("https://engine.tygron.com/api/session/event/editornetload/import/?crs=3857", options)

Latest revision as of 14:52, 11 November 2026

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));