Api session event editor measure import upgrades: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
Created page with "API Event to Import Measure Upgrade Collection {|class=wikitable !Name !Importance !Type !Description !Values |- |0 |REQUIRED |(GeometryCollection with crs: EPSG:3857) |Collection of Upgrade Geometries | |- |1 |REQUIRED |(UPGRADE_TYPE Integer ID or multiple values in array [1, 2, 3]) |Upgrade Types | |- |2 |OPTIONAL |(MEASURE Integer ID) |Set for existing Measure ID (optional) | |- |3 |OPTIONAL |(Floating point number) |Buffer for Points and Lines to make Pol..."
 
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
API Event to Import [[Measure]] Upgrade Collection
API Endpoint: api/session/event/editormeasure/import_upgrades/
 
Description: Import [[Measure]] Upgrade Collection
 
{|class=wikitable
{|class=wikitable
!Name
!Name
Line 16: Line 19:
|REQUIRED
|REQUIRED
|(UPGRADE_TYPE Integer ID or multiple values in array [1, 2, 3])
|(UPGRADE_TYPE Integer ID or multiple values in array [1, 2, 3])
|[[Upgrade Type]]s
|[[Upgrade Type]]
|
|
|-
|-
Line 28: Line 31:
|OPTIONAL
|OPTIONAL
|(Floating point number)
|(Floating point number)
|Buffer for Points and Lines to make Polygons (optional)
|Buffer for [[#Api Model Point|Point]]s and Lines to make [[#Api Model Polygon|Polygon]]s (optional)
|
|
|-
|-
Line 49: Line 52:
|}
|}
===Example POST===
===Example POST===
Example POST: https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857&f=HTML&token=API_TOKEN
Curl example POST:
 
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ {
"type" : "GeometryCollection",
"geometries" : [ {
"type" : "MultiPolygon",
"coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
} ]
}, 1 ]
'
</syntaxhighlight>
Curl example multi item POST:


with content:  
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
<pre>[ {
[ {
  "type" : "GeometryCollection",
  "type" : "GeometryCollection",
  "geometries" : [ {
  "geometries" : [ {
  "type" : "MultiPolygon",
  "type" : "MultiPolygon",
  "coordinates" : [ [ [ [ 658636.7618515313, 6799461.8964563515 ], [ 658636.7618515313, 6799439.853711299 ], [ 658750.7404743254, 6799439.853711299 ], [ 658750.7404743254, 6799461.8964563515 ], [ 658636.7618515313, 6799461.8964563515 ] ] ] ]
  "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
  }, {
  }, {
  "type" : "MultiPolygon",
  "type" : "MultiPolygon",
  "coordinates" : [ [ [ [ 658636.7618515313, 6799461.8964563515 ], [ 658636.7618515313, 6799438.630740244 ], [ 658765.0945891228, 6799438.630740244 ], [ 658765.0945891228, 6799461.8964563515 ], [ 658636.7618515313, 6799461.8964563515 ] ] ] ]
  "coordinates" : [ [ [ [ 658646.762, 6799451.896 ], [ 658646.762, 6799461.896 ], [ 658656.762, 6799461.896 ], [ 658656.762, 6799451.896 ], [ 658646.762, 6799451.896 ] ] ] ]
  }, {
  }, {
  "type" : "MultiPolygon",
  "type" : "MultiPolygon",
  "coordinates" : [ [ [ [ 658636.7618515313, 6799461.8964563515 ], [ 658636.7618515313, 6799383.693057076 ], [ 658748.1321117587, 6799383.693057076 ], [ 658748.1321117587, 6799461.8964563515 ], [ 658636.7618515313, 6799461.8964563515 ] ] ] ]
  "coordinates" : [ [ [ [ 658656.762, 6799451.896 ], [ 658656.762, 6799461.896 ], [ 658666.762, 6799461.896 ], [ 658666.762, 6799451.896 ], [ 658656.762, 6799451.896 ] ] ] ]
  } ]
  } ]
}, [ 1, 2, 3 ], "", "", "" ]
}, [ 1, 2, 3 ] ]
</pre>
'
{{article end|seealso=*[[api session event editor measure]]}}
</syntaxhighlight>
JavaScript example POST:
 
<syntaxhighlight lang="text" copy>var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ { "type" : "GeometryCollection", "geometries" : [ { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ] } ]}, 1 ]'
};
fetch("https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?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 measure]]
*[[Api session items measures]]
}}


[[Category:API]]
[[Category:API]]

Latest revision as of 08:20, 29 May 2026

API Endpoint: api/session/event/editormeasure/import_upgrades/

Description: Import Measure Upgrade Collection

Name Importance Type Description Values
0 REQUIRED (GeometryCollection with crs: EPSG:3857) Collection of Upgrade Geometries
1 REQUIRED (UPGRADE_TYPE Integer ID or multiple values in array [1, 2, 3]) Upgrade Type
2 OPTIONAL (MEASURE Integer ID) Set for existing Measure ID (optional)
3 OPTIONAL (Floating point number) Buffer for Points and Lines to make Polygons (optional)
4 OPTIONAL (SOURCE Integer ID) Source (optional)

Response Codes

Response Code: Description
200 Integer (Measure ID)
300-600 Codes Overview

Example POST

Curl example POST:

curl 'https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ {
 "type" : "GeometryCollection",
 "geometries" : [ {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
 } ]
}, 1 ]
'

Curl example multi item POST:

curl 'https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '
[ {
 "type" : "GeometryCollection",
 "geometries" : [ {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ]
 }, {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658646.762, 6799451.896 ], [ 658646.762, 6799461.896 ], [ 658656.762, 6799461.896 ], [ 658656.762, 6799451.896 ], [ 658646.762, 6799451.896 ] ] ] ]
 }, {
 "type" : "MultiPolygon",
 "coordinates" : [ [ [ [ 658656.762, 6799451.896 ], [ 658656.762, 6799461.896 ], [ 658666.762, 6799461.896 ], [ 658666.762, 6799451.896 ], [ 658656.762, 6799451.896 ] ] ] ]
 } ]
}, [ 1, 2, 3 ] ]
'

JavaScript example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ { "type" : "GeometryCollection", "geometries" : [ { "type" : "MultiPolygon", "coordinates" : [ [ [ [ 658636.762, 6799451.896 ], [ 658636.762, 6799461.896 ], [ 658646.762, 6799461.896 ], [ 658646.762, 6799451.896 ], [ 658636.762, 6799451.896 ] ] ] ] } ]}, 1 ]'
};
fetch("https://engine.tygron.com/api/session/event/editormeasure/import_upgrades/?crs=3857", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));