Api session event editor netnode set location: 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 1: | Line 1: | ||
API Endpoint: editornetnode/set_location | API Endpoint: api/session/event/editornetnode/set_location/ | ||
Description: Set Location | |||
{|class=wikitable | {|class=wikitable | ||
| Line 27: | Line 25: | ||
|REQUIRED | |REQUIRED | ||
|(Point 3D with crs: EPSG:3857) | |(Point 3D with crs: EPSG:3857) | ||
|Location Point | |Location [[#Api Model Point|Point]] | ||
| | | | ||
|- | |- | ||
| Line 53: | Line 51: | ||
[ "ELECTRICITY", 1, { | [ "ELECTRICITY", 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658663.6461762928, 6799318.783721327, -1.95 ] | ||
} | } ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 62: | Line 60: | ||
[ "ELECTRICITY", 1, { | [ "ELECTRICITY", 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658798.1311414078, 6799429.387813576, -0.03 ] | ||
} | } ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 71: | Line 69: | ||
method: "POST", | method: "POST", | ||
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | ||
body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ | body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658663.6461762928, 6799318.783721327, -1.95 ]} ]' | ||
}; | }; | ||
fetch("https://engine.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options) | fetch("https://engine.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options) | ||
| Line 79: | Line 77: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{article end|seealso=*[[Api session event editor netnode]] | {{article end|seealso=*[[Api session event editor netnode]] | ||
*[[Api session items netnodes]] | |||
}} | }} | ||
[[Category:API]] | [[Category:API]] | ||
Latest revision as of 08:21, 29 May 2026
API Endpoint: api/session/event/editornetnode/set_location/
Description: Set Location
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (Enumeration) | Network type | ELECTRICITY, GAS, HEAT, INTERNET or SEWER |
| 1 | REQUIRED | (NET_NODE Integer ID) | Net Node ID | |
| 2 | REQUIRED | (Point 3D with crs: EPSG:3857) | Location Point | |
| 3 | OPTIONAL | (Floating point number) | Node merge distance (optional, default: 1.0m) |
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/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
"type" : "Point",
"coordinates" : [ 658663.6461762928, 6799318.783721327, -1.95 ]
} ]
'Curl example multi item POST:
curl 'https://engine.tygron.com/api/session/event/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
"type" : "Point",
"coordinates" : [ 658798.1311414078, 6799429.387813576, -0.03 ]
} ]
'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658663.6461762928, 6799318.783721327, -1.95 ]} ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));