Api session event logic measurement line add: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
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 LineMeasurement for an [[Overlay]] for a specific [[Timeframe]].
Description: Add a Line [[Measurement]] for an [[Overlay]] for a specific [[Timeframe]].


{|class=wikitable
{|class=wikitable
Line 13: Line 13:
| REQUIRED
| REQUIRED
| (OVERLAY Integer ID or multiple integer values in array [1, 2, 3])
| (OVERLAY Integer ID or multiple integer values in array [1, 2, 3])
| [[Overlay]] IDs
| [[Overlay]]s
|  
|  
|-
|-
Line 58: Line 58:
|-
|-
| 200
| 200
| Integer (Measurement ID)
| Integer (Measurement)
|-
|-
| 300-600
| 300-600
Line 68: Line 68:
[ 1, {
[ 1, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658797.650397124, 6799437.237235598 ]
  "coordinates" : [ 658797.1534114793, 6799449.129132586 ]
}, {
}, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658728.9234541768, 6799301.930376602 ]
  "coordinates" : [ 658675.1353150207, 6799350.229749473 ]
}, "Name", -1, true, true ]
}, "Name", -1, true, true ]
'
'
Line 79: Line 79:
[ [ 1, 2, 3 ], {
[ [ 1, 2, 3 ], {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658699.9212559488, 6799332.816021241 ]
  "coordinates" : [ 658754.4158943058, 6799386.108124475 ]
}, {
}, {
  "type" : "Point",
  "type" : "Point",
  "coordinates" : [ 658669.0756632545, 6799449.0804085815 ]
  "coordinates" : [ 658696.6616148085, 6799360.52501269 ]
}, "Name", -1, true, true ]
}, "Name", -1, true, true ]
'
'
Line 90: Line 90:
 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" : [ 658797.650397124, 6799437.237235598 ]}, { "type" : "Point", "coordinates" : [ 658728.9234541768, 6799301.930376602 ]}, "Name", -1, true, true ]'
 body: '[ 1, { "type" : "Point", "coordinates" : [ 658797.1534114793, 6799449.129132586 ]}, { "type" : "Point", "coordinates" : [ 658675.1353150207, 6799350.229749473 ]}, "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)

Revision as of 15:33, 10 November 2026

API Endpoint: api/session/event/logic/measurement_line_add/

Description: Add a Line Measurement for an Overlay for a specific Timeframe.

Index Importance Type Description Values
0 REQUIRED (OVERLAY Integer ID or multiple integer values in array [1, 2, 3]) Overlays
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)
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" : [ 658797.1534114793, 6799449.129132586 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658675.1353150207, 6799350.229749473 ]
}, "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" : [ 658754.4158943058, 6799386.108124475 ]
}, {
 "type" : "Point",
 "coordinates" : [ 658696.6616148085, 6799360.52501269 ]
}, "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" : [ 658797.1534114793, 6799449.129132586 ]}, { "type" : "Point", "coordinates" : [ 658675.1353150207, 6799350.229749473 ]}, "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));