Api session event editor netnode set location: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 48: | Line 48: | ||
[ "ELECTRICITY", 1, { | [ "ELECTRICITY", 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658786.2911892836, 6799376.1538936775, -1.07 ] | ||
}, 1.0 ] | }, 1.0 ] | ||
' | ' | ||
| Line 57: | Line 57: | ||
[ "ELECTRICITY", 1, { | [ "ELECTRICITY", 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658698.5813436714, 6799323.240273199, -1.67 ] | ||
}, 1.0 ] | }, 1.0 ] | ||
' | ' | ||
| Line 65: | Line 65: | ||
<syntaxhighlight lang="text" copy>var options = { | <syntaxhighlight lang="text" copy>var options = { | ||
method: "POST", | method: "POST", | ||
headers: { "Content-Type": "application/json", "Authorization": "Bearer | headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | ||
body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ | body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658786.2911892836, 6799376.1538936775, -1.07 ]}, 1.0 ]' | ||
}; | }; | ||
fetch("https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options) | fetch("https://development.tygron.com/api/session/event/editornetnode/set_location/?crs=3857", options) | ||
Revision as of 06:54, 10 April 2026
API Event to 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://development.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" : [ 658786.2911892836, 6799376.1538936775, -1.07 ]
}, 1.0 ]
'Curl Example multi item POST:
curl 'https://development.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" : [ 658698.5813436714, 6799323.240273199, -1.67 ]
}, 1.0 ]
'JavaScript Example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658786.2911892836, 6799376.1538936775, -1.07 ]}, 1.0 ]'
};
fetch("https://development.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));