Api session event editor netline add for points
Jump to navigation
Jump to search
API Endpoint: editornetline/add_for_points.
Description: Connect start and end point with one (or more) Net Line(s) of a specified Net Function. Nodes are created for start and end point. Optionally connection the two points using the road system. Also specify at what distance the new Nodes are merged with existing Nodes.
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (NET_FUNCTION Integer ID or multiple 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" : [ 658748.900328131, 6799399.724765443, -0.98 ]
}, {
"type" : "Point",
"coordinates" : [ 658702.0115191017, 6799417.361143041, -1.85 ]
}, false, 1.0 ]
'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" : [ 658676.9608439902, 6799333.23341757, -0.32 ]
}, {
"type" : "Point",
"coordinates" : [ 658641.9412215346, 6799402.43217997, -1.26 ]
}, {
"type" : "Point",
"coordinates" : [ 658641.2103602923, 6799368.440956747, -0.81 ]
} ], [ {
"type" : "Point",
"coordinates" : [ 658658.3417478102, 6799333.295133758, -1.94 ]
}, {
"type" : "Point",
"coordinates" : [ 658739.6995971594, 6799330.0647790395, -0.68 ]
}, {
"type" : "Point",
"coordinates" : [ 658775.5231669814, 6799321.9669724135, -1.89 ]
} ], false, 1.0 ]
'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "type" : "Point", "coordinates" : [ 658748.900328131, 6799399.724765443, -0.98 ]}, { "type" : "Point", "coordinates" : [ 658702.0115191017, 6799417.361143041, -1.85 ]}, false, 1.0 ]'
};
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));