Api session event editor netline add for points

From Tygron Support wiki
Revision as of 09:59, 13 July 2026 by Frank@tygron.nl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

API Endpoint: api/session/event/editornetline/add_for_points/

Description: Connect start and end Points with one or more Net Lines of a specified Net Function. Nodes are created for both Points. Optionally connect the Points using the road system and specify the merge distance for existing Nodes.

Index Importance Type Description Values
0 REQUIRED (NET_FUNCTION Integer ID or multiple integer values in array [1, 2, 3]) Net Function ID
1 REQUIRED (Point 3D with crs: EPSG:3857 or multiple values in array [a, b, c]) Start Point
2 REQUIRED (Point 3D with crs: EPSG:3857 or multiple values in array [a, b, c]) End Point
3 OPTIONAL (true, false) Connect via Roads (false = connect direct between Points)
4 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/add_for_points/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
 "type" : "Point",
 "coordinates" : [ 658645.582534657, 6799457.901082544, -1.9 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658793.5819362089, 6799301.886525795, -1.38 ]
} ]
'

Curl example multi item POST

curl 'https://engine.tygron.com/api/session/event/editornetline/add_for_points/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ [ 1, 2, 3 ], [ {
 "type" : "Point",
 "coordinates" : [ 658784.1928054504, 6799344.5567223495, -1.45 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658691.3198311959, 6799409.682273481, -0.56 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658778.9565906838, 6799421.676450048, -0.4 ]
} ], [ {
 "type" : "Point",
 "coordinates" : [ 658746.0337279254, 6799361.130807889, -0.1 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658708.7809183408, 6799423.230740717, -0.59 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658714.0398710127, 6799328.289627394, -0.85 ]
} ] ]
'

JavaScript example POST

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ 1, { "type" : "Point", "coordinates" : [ 658645.582534657, 6799457.901082544, -1.9 ]}, { "type" : "Point", "coordinates" : [ 658793.5819362089, 6799301.886525795, -1.38 ]} ]'
};
fetch("https://engine.tygron.com/api/session/event/editornetline/add_for_points/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));