Api session event editor netcluster generate clusters: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
{|class=wikitable | {|class=wikitable | ||
! | !Index | ||
!Importance | !Importance | ||
!Type | !Type | ||
| Line 10: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(NetType or multiple values in array [a, b, c]) | | (NetType or multiple values in array [a, b, c]) | ||
|[[Net Type]][] | | [[Net Type]][] | ||
| | | | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(Enumeration) | | (Enumeration) | ||
|ClusteringType | | ClusteringType | ||
|ADD_TO_EXISTING_FOR_BUILDINGS, MAP_SECTORS, PER_ATTRIBUTE, PER_BUILDING, PER_LOAD or PER_LOAD_UNIQUE_OWNER | | ADD_TO_EXISTING_FOR_BUILDINGS, MAP_SECTORS, PER_ATTRIBUTE, PER_BUILDING, PER_LOAD or PER_LOAD_UNIQUE_OWNER | ||
|- | |- | ||
|2 | | 2 | ||
|REQUIRED | | REQUIRED | ||
|(MultiPolygon with crs: EPSG:3857) | | (MultiPolygon with crs: EPSG:3857) | ||
|[[ | | [[MultiPolygon]] | ||
| | | | ||
|- | |- | ||
|3 | | 3 | ||
|REQUIRED | | REQUIRED | ||
|(Integer number or multiple values in array [1, 2, 3]) | | (Integer number or multiple integer values in array [1, 2, 3]) | ||
|Integer[] | | Integer[] | ||
| | | | ||
|- | |- | ||
|4 | | 4 | ||
|REQUIRED | | REQUIRED | ||
|(Floating point number) | | (Floating point number) | ||
|Double | | Double | ||
| | | | ||
|- | |- | ||
|5 | | 5 | ||
|REQUIRED | | REQUIRED | ||
|(STAKEHOLDER Integer ID) | | (STAKEHOLDER Integer ID) | ||
|[[Stakeholder]]s | | [[Stakeholder]]s | ||
| | | | ||
|- | |- | ||
|6 | | 6 | ||
|REQUIRED | | REQUIRED | ||
|(String) | | (String) | ||
|String | | String | ||
| | | | ||
|- | |- | ||
|7 | | 7 | ||
|REQUIRED | | REQUIRED | ||
|(true, false) | | (true, false) | ||
|Boolean | | Boolean | ||
|true or false | | true or false | ||
|- | |- | ||
|8 | | 8 | ||
|OPTIONAL | | OPTIONAL | ||
|(Floating point number) | | (Floating point number) | ||
|Double | | Double | ||
| | | | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 69: | Line 69: | ||
!Description | !Description | ||
|- | |- | ||
|204 | | 204 | ||
|No Content | | No Content | ||
|- | |- | ||
|300-600 | | 300-600 | ||
|Codes Overview | | Codes Overview | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl example POST | Curl example POST | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ "ELECTRICITY", "PER_LOAD", { | [ "ELECTRICITY", "PER_LOAD", { | ||
"type" : "MultiPolygon", | "type" : "MultiPolygon", | ||
"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 ] ] ] ] | ||
}, 1, | }, 1, 35, 1, "Text", true ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Curl example multi item POST | Curl example multi item POST | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ [ "ELECTRICITY", "GAS", "HEAT" ], "PER_LOAD", { | [ [ "ELECTRICITY", "GAS", "HEAT" ], "PER_LOAD", { | ||
"type" : "MultiPolygon", | "type" : "MultiPolygon", | ||
"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 ] ] ] ] | ||
}, [ 1, 2, 3 ], | }, [ 1, 2, 3 ], 18, 1, "Text", true ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
JavaScript example POST | JavaScript example POST | ||
<syntaxhighlight lang="text" copy>var options = { | <syntaxhighlight lang="text" copy>var options = { | ||
method: "POST", | method: "POST", | ||
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | ||
body: '[ "ELECTRICITY", "PER_LOAD", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, 1, | body: '[ "ELECTRICITY", "PER_LOAD", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, 1, 35, 1, "Text", true ]' | ||
}; | }; | ||
fetch("https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857", options) | fetch("https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857", options) | ||
Latest revision as of 13:01, 19 June 2026
API Endpoint: api/session/event/editornetcluster/generate_clusters/
Description: Generate Clusters
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (NetType or multiple values in array [a, b, c]) | Net Type[] | |
| 1 | REQUIRED | (Enumeration) | ClusteringType | ADD_TO_EXISTING_FOR_BUILDINGS, MAP_SECTORS, PER_ATTRIBUTE, PER_BUILDING, PER_LOAD or PER_LOAD_UNIQUE_OWNER |
| 2 | REQUIRED | (MultiPolygon with crs: EPSG:3857) | MultiPolygon | |
| 3 | REQUIRED | (Integer number or multiple integer values in array [1, 2, 3]) | Integer[] | |
| 4 | REQUIRED | (Floating point number) | Double | |
| 5 | REQUIRED | (STAKEHOLDER Integer ID) | Stakeholders | |
| 6 | REQUIRED | (String) | String | |
| 7 | REQUIRED | (true, false) | Boolean | true or false |
| 8 | OPTIONAL | (Floating point number) | Double |
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/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", "PER_LOAD", {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, 1, 35, 1, "Text", true ]
'Curl example multi item POST
curl 'https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ [ "ELECTRICITY", "GAS", "HEAT" ], "PER_LOAD", {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
}, [ 1, 2, 3 ], 18, 1, "Text", true ]
'JavaScript example POST
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ "ELECTRICITY", "PER_LOAD", { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]}, 1, 35, 1, "Text", true ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetcluster/generate_clusters/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));