Api session event editor netload generate loads and paths
Jump to navigation
Jump to search
API Endpoint: api/session/event/editornetload/generate_loads_and_paths/
Description: Generate Net Loads and Net Lines given a Net Function, for Addresses of Buildings inside the provided Polygons, for Buildings of the provided Category and Stakeholders and optionally only for Buildings without Net Loads. Addresses are bundled into one Net Load given a bundle threshold. Net Loads are set as Collective given another threshold. Stakeholder owning the Net Load can be mapped from the Building owner to a different one using the mappingIDs. Net Lines are generated with a Search Range for paths to existing Net Nodes and a Merge Range to combine Net Nodes
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (NET_FUNCTION Integer ID) | Net Function | |
| 1 | REQUIRED | (MultiPolygon with crs: EPSG:3857) | Region | |
| 2 | REQUIRED | (Category or multiple values in array [a, b, c]) | Building Categories | |
| 3 | REQUIRED | (Integer number) | Bundle Threshold | |
| 4 | REQUIRED | (Integer number) | Collective Threshold | |
| 5 | REQUIRED | (STAKEHOLDER Integer ID or multiple integer values in array [1, 2, 3]) | Stakeholders (Building owners) | |
| 6 | REQUIRED | (STAKEHOLDER Integer ID or multiple integer values in array [1, 2, 3]) | Stakeholders (mapped) | |
| 7 | REQUIRED | (true, false) | Skip Buildings with Net Loads | true or false |
| 8 | REQUIRED | (Floating point number) | Search Range | |
| 9 | REQUIRED | (Floating point number) | Merge Range |
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/generate_loads_and_paths/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, "SOCIAL", 1, 1, 1, 1, true, 49, 21 ]
'Curl example multi item POST
curl 'https://engine.tygron.com/api/session/event/editornetload/generate_loads_and_paths/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, [ "SOCIAL", "NORMAL", "LUXE" ], 1, 1, [ 1, 2, 3 ], [ 1, 2, 3 ], true, 62, 11 ]
'JavaScript example POST
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, "SOCIAL", 1, 1, 1, 1, true, 49, 21 ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetload/generate_loads_and_paths/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));