Api session event editor netline insert point: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:
|}
|}
===Example POST===
===Example POST===
Example POST: https://engine.tygron.com/api/session/event/editornetline/insert_point/?crs=3857&f=JSON&token=API_TOKEN
Curl Example POST:


with content:  
<syntaxhighlight lang="text" copy>curl 'https://development.tygron.com/api/session/event/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
<pre>[ 22, {
[ 1, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658777.366561448, 6799318.4767650375, -0.19 ]
  "coordinates" : [ 658695.8885260279, 6799369.563221905, -0.31 ]
}, 1.0 ]
}, 1.0 ]
</pre>
'
</syntaxhighlight>
Curl Example multi item POST:
 
<syntaxhighlight lang="text" copy>curl 'https://development.tygron.com/api/session/event/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"type" : "Point",
"coordinates" : [ 658709.6969310978, 6799435.039786458, -1.38 ]
}, 1.0 ]
'
</syntaxhighlight>
JavaScript Example POST:
 
<syntaxhighlight lang="text" copy>var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ 1, { "type" : "Point", "coordinates" : [ 658695.8885260279, 6799369.563221905, -0.31 ]}, 1.0 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetline/insert_point/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));
</syntaxhighlight>
{{article end|seealso=*[[Api session event editor netline]]
{{article end|seealso=*[[Api session event editor netline]]
*[[Api session items netlines]]
*[[Api session items netlines]]

Revision as of 15:27, 8 April 2026

API Event to Insert a new Node in an existing Net Line, potentially splitting the Net Line into two parts. Also specify at what distance the new Nodes are merged with existing Nodes.

Name Importance Type Description Values
0 REQUIRED (NET_LINE Integer ID) Net Line ID
1 REQUIRED (Point 3D with crs: EPSG:3857) Inserted Node Point
2 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/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
 "type" : "Point",
 "coordinates" : [ 658695.8885260279, 6799369.563221905, -0.31 ]
}, 1.0 ]
'

Curl Example multi item POST:

curl 'https://development.tygron.com/api/session/event/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
 "type" : "Point",
 "coordinates" : [ 658709.6969310978, 6799435.039786458, -1.38 ]
}, 1.0 ]
'

JavaScript Example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ 1, { "type" : "Point", "coordinates" : [ 658695.8885260279, 6799369.563221905, -0.31 ]}, 1.0 ]'
};
fetch("https://development.tygron.com/api/session/event/editornetline/insert_point/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));