Api session event editor netnode set location: 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 4: Line 4:


{|class=wikitable
{|class=wikitable
!Name
!Index
!Importance
!Importance
!Type
!Type
Line 25: Line 25:
| REQUIRED
| REQUIRED
| (Point 3D with crs: EPSG:3857)
| (Point 3D with crs: EPSG:3857)
| Location [[#Api Model Point|Point]]
| Location [[Point]]
|  
|  
|-
|-
Line 46: Line 46:
|}
|}
===Example POST===
===Example POST===
Curl example POST:
Curl example POST
 
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetnode/set_location/?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/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
[ "ELECTRICITY", 1, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658746.1003175053, 6799378.114205416, -1.93 ]
  "coordinates" : [ 658637.3936404719, 6799326.503107377, -1.85 ]
} ]
} ]
'
'
</syntaxhighlight>
</syntaxhighlight>
Curl example multi item POST:
Curl example multi item POST
 
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetnode/set_location/?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/editornetnode/set_location/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ "ELECTRICITY", 1, {
[ "ELECTRICITY", 1, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658738.4425158227, 6799360.313877646, -0.6 ]
  "coordinates" : [ 658690.7432628826, 6799374.343001317, -0.94 ]
} ]
} ]
'
'
</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", 1, { "type" : "Point", "coordinates" : [ 658746.1003175053, 6799378.114205416, -1.93 ]} ]'
 body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658637.3936404719, 6799326.503107377, -1.85 ]} ]'
};
};
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)

Latest revision as of 13:01, 19 June 2026

API Endpoint: api/session/event/editornetnode/set_location/

Description: Set Location

Index 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" : [ 658637.3936404719, 6799326.503107377, -1.85 ]
} ]
'

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" : [ 658690.7432628826, 6799374.343001317, -0.94 ]
} ]
'

JavaScript example POST

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ "ELECTRICITY", 1, { "type" : "Point", "coordinates" : [ 658637.3936404719, 6799326.503107377, -1.85 ]} ]'
};
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));