Api session event editor netline insert point: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
API Endpoint 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. | API Endpoint: editornetline/insert_point. | ||
API Endpoint name is Api session event editor netline insert point. | |||
Use this endpoint 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. | |||
{|class=wikitable | {|class=wikitable | ||
!Name | !Name | ||
| Line 37: | Line 42: | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl | Curl example POST: | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetline/insert_point/?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/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ 1, { | [ 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658720.5217981633, 6799405.633329327, -0.2 ] | ||
}, 1.0 ] | }, 1.0 ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Curl | Curl example multi item POST: | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editornetline/insert_point/?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/editornetline/insert_point/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ 1, { | [ 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658774.9076194018, 6799351.883097376, -0.68 ] | ||
}, 1.0 ] | }, 1.0 ] | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
JavaScript | 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: '[ 1, { "type" : "Point", "coordinates" : [ | body: '[ 1, { "type" : "Point", "coordinates" : [ 658720.5217981633, 6799405.633329327, -0.2 ]}, 1.0 ]' | ||
}; | }; | ||
fetch("https://engine.tygron.com/api/session/event/editornetline/insert_point/?crs=3857", options) | fetch("https://engine.tygron.com/api/session/event/editornetline/insert_point/?crs=3857", options) | ||
| Line 68: | Line 73: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{article end|seealso=*[[Api session event editor netline]] | {{article end|seealso=*[[Api session event editor netline]] | ||
}} | }} | ||
[[Category:API]] | [[Category:API]] | ||
Revision as of 11:27, 10 April 2026
API Endpoint: editornetline/insert_point.
API Endpoint name is Api session event editor netline insert point.
Use this endpoint 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://engine.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" : [ 658720.5217981633, 6799405.633329327, -0.2 ]
}, 1.0 ]
'Curl example multi item POST:
curl 'https://engine.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" : [ 658774.9076194018, 6799351.883097376, -0.68 ]
}, 1.0 ]
'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "type" : "Point", "coordinates" : [ 658720.5217981633, 6799405.633329327, -0.2 ]}, 1.0 ]'
};
fetch("https://engine.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));