Api session event logic measurement line add: Difference between revisions
Jump to navigation
Jump to search
Created page with "API Endpoint: api/session/event/logic/measurement_line_add/ Description: Add a LineMeasurement for an Overlay for a specific Timeframe. {|class=wikitable !Name !Importance !Type !Description !Values |- |0 |REQUIRED |(OVERLAY Integer ID or multiple values in array [1, 2, 3]) |Overlay IDs | |- |1 |REQUIRED |(Point with crs: EPSG:3857) |Point start | |- |2 |REQUIRED |(Point with crs: EPSG:3857) |Point end | |- |3 |..." |
No edit summary |
||
| Line 1: | Line 1: | ||
API Endpoint: api/session/event/logic/measurement_line_add/ | API Endpoint: api/session/event/logic/measurement_line_add/ | ||
Description: Add a Line[[Measurement]] for an [[Overlay]] for a specific [[ | Description: Add a Line[[Measurement]] for an [[Overlay]] for a specific [[Timeframe]]. | ||
{|class=wikitable | {|class=wikitable | ||
| Line 37: | Line 37: | ||
|REQUIRED | |REQUIRED | ||
|(Integer number) | |(Integer number) | ||
|[[ | |[[Timeframe]] (-1 for automatic last) | ||
| | | | ||
|- | |- | ||
| Line 69: | Line 69: | ||
[ 1, { | [ 1, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658719.2630926905, 6799322.782274678 ] | ||
}, { | }, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658798.7954130701, 6799315.42181975 ] | ||
}, "Name", -1, true, true ] | }, "Name", -1, true, true ] | ||
' | ' | ||
| Line 81: | Line 81: | ||
[ [ 1, 2, 3 ], { | [ [ 1, 2, 3 ], { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658689.8581087114, 6799445.903604035 ] | ||
}, { | }, { | ||
"type" : "Point", | "type" : "Point", | ||
"coordinates" : [ | "coordinates" : [ 658707.0918168032, 6799332.859872217 ] | ||
}, "Name", -1, true, true ] | }, "Name", -1, true, true ] | ||
' | ' | ||
| Line 93: | Line 93: | ||
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" : [ 658719.2630926905, 6799322.782274678 ]}, { "type" : "Point", "coordinates" : [ 658798.7954130701, 6799315.42181975 ]}, "Name", -1, true, true ]' | ||
}; | }; | ||
fetch("https://engine.tygron.com/api/session/event/logic/measurement_line_add/?crs=3857", options) | fetch("https://engine.tygron.com/api/session/event/logic/measurement_line_add/?crs=3857", options) | ||
Latest revision as of 14:49, 2 June 2026
API Endpoint: api/session/event/logic/measurement_line_add/
Description: Add a LineMeasurement for an Overlay for a specific Timeframe.
| Name | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (OVERLAY Integer ID or multiple values in array [1, 2, 3]) | Overlay IDs | |
| 1 | REQUIRED | (Point with crs: EPSG:3857) | Point start | |
| 2 | REQUIRED | (Point with crs: EPSG:3857) | Point end | |
| 3 | REQUIRED | (String) | Name | |
| 4 | REQUIRED | (Integer number) | Timeframe (-1 for automatic last) | |
| 5 | REQUIRED | (true, false) | Save Measurement | true or false |
| 6 | REQUIRED | (true, false) | Sum | true or false |
Response Codes
| Response Code: | Description |
|---|---|
| 200 | Integer (Measurement ID) |
| 300-600 | Codes Overview |
Example POST
Curl example POST:
curl 'https://engine.tygron.com/api/session/event/logic/measurement_line_add/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ 1, {
"type" : "Point",
"coordinates" : [ 658719.2630926905, 6799322.782274678 ]
}, {
"type" : "Point",
"coordinates" : [ 658798.7954130701, 6799315.42181975 ]
}, "Name", -1, true, true ]
'Curl example multi item POST:
curl 'https://engine.tygron.com/api/session/event/logic/measurement_line_add/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ [ 1, 2, 3 ], {
"type" : "Point",
"coordinates" : [ 658689.8581087114, 6799445.903604035 ]
}, {
"type" : "Point",
"coordinates" : [ 658707.0918168032, 6799332.859872217 ]
}, "Name", -1, true, true ]
'JavaScript example POST:
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ 1, { "type" : "Point", "coordinates" : [ 658719.2630926905, 6799322.782274678 ]}, { "type" : "Point", "coordinates" : [ 658798.7954130701, 6799315.42181975 ]}, "Name", -1, true, true ]'
};
fetch("https://engine.tygron.com/api/session/event/logic/measurement_line_add/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));