Api session event editor measure import grids: Difference between revisions
Jump to navigation
Jump to search
Created page with "API Event to Import Measure Grid Collection {|class=wikitable !Name !Importance !Type !Description !Values |- |0 |REQUIRED |(GeometryCollection with crs: EPSG:3857) |Collection of Grid Geometries where the Grid will be applied | |- |1 |REQUIRED |(TERRAIN_TYPE Integer ID or multiple values in array [1, 2, 3]) |Terrain Type IDs | |- |2 |REQUIRED |(Integer or multiple values in array [a, b, c]) |Grid ID arrays | |- |3 |OPTIONAL |(MEASURE Integer ID) |Set for existin..." |
No edit summary |
||
| (18 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
API | API Endpoint: api/session/event/editormeasure/import_grids/ | ||
Description: Import [[Measure]] [[Grid]] Collection | |||
{|class=wikitable | {|class=wikitable | ||
! | !Index | ||
!Importance | !Importance | ||
!Type | !Type | ||
| Line 7: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(GeometryCollection with crs: EPSG:3857) | | (GeometryCollection with crs: EPSG:3857) | ||
|Collection of Grid Geometries where the Grid will be applied | | Collection of [[Grid]] Geometries where the [[Grid]] will be applied | ||
| | | | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(TERRAIN_TYPE Integer ID or multiple values in array [1, 2, 3]) | | (TERRAIN_TYPE Integer ID or multiple integer values in array [1, 2, 3]) | ||
|[[Terrain]] | | [[Terrain Type]] IDs | ||
| | | | ||
|- | |- | ||
|2 | | 2 | ||
|REQUIRED | | REQUIRED | ||
|(Integer or multiple values in array [a, b, c]) | | (Integer or multiple values in array [a, b, c]) | ||
|Grid ID arrays | | [[Grid]] ID arrays | ||
| | | | ||
|- | |- | ||
|3 | | 3 | ||
|OPTIONAL | | OPTIONAL | ||
|(MEASURE Integer ID) | | (MEASURE Integer ID) | ||
|Set for existing [[Measure]] ID (optional) | | Set for existing [[Measure]] ID (optional) | ||
| | | | ||
|- | |- | ||
|4 | | 4 | ||
|OPTIONAL | | OPTIONAL | ||
|(Floating point number) | | (Floating point number) | ||
|Buffer for | | Buffer for [[Point]]s and Lines to make [[Polygon]]s (optional) | ||
| | | | ||
|- | |- | ||
|5 | | 5 | ||
|OPTIONAL | | OPTIONAL | ||
|(SOURCE Integer ID) | | (SOURCE Integer ID) | ||
|[[Source]] (optional) | | [[Source]] (optional) | ||
| | | | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 48: | Line 51: | ||
!Description | !Description | ||
|- | |- | ||
|200 | | 200 | ||
|Integer (Measure ID) | | Integer (Measure ID) | ||
|- | |- | ||
|300-600 | | 300-600 | ||
|Codes Overview | | Codes Overview | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl example POST | |||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_grids/?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, [ 1, 2 ] ] | |||
' | |||
</syntaxhighlight> | |||
Curl example multi item POST | |||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_grids/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | |||
[ { | |||
"type" : "GeometryCollection", | "type" : "GeometryCollection", | ||
"geometries" : [ { | "geometries" : [ { | ||
"type" : "MultiPolygon", | "type" : "MultiPolygon", | ||
"coordinates" : [ [ [ [ 658636. | "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" : [ [ [ [ | "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" : [ [ [ [ | "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, 4 ], [ 5, 6 ] ], "", "", "" ] | }, [ 1, 2, 3 ], [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ] | ||
</ | ' | ||
{{article end|seealso=*[[ | </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, [ 1, 2 ] ]' | |||
}; | |||
fetch("https://engine.tygron.com/api/session/event/editormeasure/import_grids/?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 13:01, 19 June 2026
API Endpoint: api/session/event/editormeasure/import_grids/
Description: Import Measure Grid Collection
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (GeometryCollection with crs: EPSG:3857) | Collection of Grid Geometries where the Grid will be applied | |
| 1 | REQUIRED | (TERRAIN_TYPE Integer ID or multiple integer values in array [1, 2, 3]) | Terrain Type IDs | |
| 2 | REQUIRED | (Integer or multiple values in array [a, b, c]) | Grid ID arrays | |
| 3 | OPTIONAL | (MEASURE Integer ID) | Set for existing Measure ID (optional) | |
| 4 | OPTIONAL | (Floating point number) | Buffer for Points and Lines to make Polygons (optional) | |
| 5 | 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_grids/?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, [ 1, 2 ] ]
'Curl example multi item POST
curl 'https://engine.tygron.com/api/session/event/editormeasure/import_grids/?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 ], [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ]
'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, [ 1, 2 ] ]'
};
fetch("https://engine.tygron.com/api/session/event/editormeasure/import_grids/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));