Api session event editor netline insert point: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (14 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
API | API Endpoint: api/session/event/editornetline/insert_point/ | ||
Description: Insert a new [[Net Node]] in an existing [[Net Line]], potentially splitting the [[Net Line]] into two parts. Also specify at what distance the new [[Net Node]]s are merged with existing [[Net Node]]s | |||
{|class=wikitable | {|class=wikitable | ||
! | !Index | ||
!Importance | !Importance | ||
!Type | !Type | ||
| Line 7: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(NET_LINE Integer ID) | | (NET_LINE Integer ID) | ||
|[[Net Line]] | | [[Net Line]] | ||
| | | | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(Point 3D with crs: EPSG:3857) | | (Point 3D with crs: EPSG:3857) | ||
|Inserted Node Point | | Inserted Node [[Point]] | ||
| | | | ||
|- | |- | ||
|2 | | 2 | ||
|OPTIONAL | | OPTIONAL | ||
|(Floating point number) | | (Floating point number) | ||
|Node merge distance (optional, default: 1.0m) | | Node merge distance (optional, default: 1.0m) | ||
| | | | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 30: | Line 33: | ||
!Description | !Description | ||
|- | |- | ||
|204 | | 204 | ||
|No Content | | No Content | ||
|- | |- | ||
|300-600 | | 300-600 | ||
|Codes Overview | | Codes Overview | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
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 ' | |||
[ 1, { | |||
< | "type" : "Point", | ||
"coordinates" : [ 658749.6717927756, 6799378.003765303, -0.94 ] | |||
} ] | |||
' | |||
</syntaxhighlight> | |||
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 ' | |||
[ 1, { | |||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658639.8428377013, 6799306.978093399, -0.63 ] | ||
}, 1.0 ] | } ] | ||
</ | ' | ||
{{article end|seealso=*[[ | </syntaxhighlight> | ||
*[[ | JavaScript example POST | ||
<syntaxhighlight lang="text" copy>var options = { | |||
method: "POST", | |||
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | |||
body: '[ 1, { "type" : "Point", "coordinates" : [ 658749.6717927756, 6799378.003765303, -0.94 ]} ]' | |||
}; | |||
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)); | |||
</syntaxhighlight> | |||
{{article end|seealso=*[[Api session event editor netline]] | |||
*[[Api session items netlines]] | |||
}} | }} | ||
[[Category:API]] | [[Category:API]] | ||
Latest revision as of 14:52, 11 November 2026
API Endpoint: api/session/event/editornetline/insert_point/
Description: Insert a new Net Node in an existing Net Line, potentially splitting the Net Line into two parts. Also specify at what distance the new Net Nodes are merged with existing Net Nodes
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (NET_LINE Integer ID) | Net Line | |
| 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" : [ 658749.6717927756, 6799378.003765303, -0.94 ]
} ]
'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" : [ 658639.8428377013, 6799306.978093399, -0.63 ]
} ]
'JavaScript example POST
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "type" : "Point", "coordinates" : [ 658749.6717927756, 6799378.003765303, -0.94 ]} ]'
};
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));