Api session event editor measure import terrains: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
{|class=wikitable | {|class=wikitable | ||
! | !Index | ||
!Importance | !Importance | ||
!Type | !Type | ||
| Line 10: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(GeometryCollection with crs: EPSG:3857) | | (GeometryCollection with crs: EPSG:3857) | ||
|Collection of [[Terrain]] Geometries | | Collection of [[Terrain]] Geometries | ||
| | | | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(Enumeration) | | (Enumeration) | ||
|[[Measure]] Edit Type | | [[Measure]] Edit Type | ||
|BUILDING, FLATTEN, GEOTIFF, GRID, LEVEE, RAISE, UPGRADE or WATER | | BUILDING, FLATTEN, GEOTIFF, GRID, LEVEE, RAISE, UPGRADE or WATER | ||
|- | |- | ||
|2 | | 2 | ||
|REQUIRED | | REQUIRED | ||
|(Boolean or multiple values in array [true, false, true]) | | (Boolean or multiple boolean values in array [true, false, true]) | ||
|Is Inner | | Is Inner | ||
| | | | ||
|- | |- | ||
|3 | | 3 | ||
|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 Type]] IDs | | [[Terrain Type]] IDs | ||
| | | | ||
|- | |- | ||
|4 | | 4 | ||
|REQUIRED | | REQUIRED | ||
|(Floating point number or multiple values in array [1.0, 2.0, 3.0]) | | (Floating point number or multiple values in array [1.0, 2.0, 3.0]) | ||
|Override Inner [[Height sector|Heights]] | | Override Inner [[Height sector|Heights]] | ||
| | | | ||
|- | |- | ||
|5 | | 5 | ||
|REQUIRED | | REQUIRED | ||
|(Boolean or multiple values in array [true, false, true]) | | (Boolean or multiple boolean values in array [true, false, true]) | ||
|Height Relative | | Height Relative | ||
| | | | ||
|- | |- | ||
|6 | | 6 | ||
|OPTIONAL | | OPTIONAL | ||
|(MEASURE Integer ID) | | (MEASURE Integer ID) | ||
|Set for existing [[Measure]] ID (optional) | | Set for existing [[Measure]] ID (optional) | ||
| | | | ||
|- | |- | ||
|7 | | 7 | ||
|OPTIONAL | | OPTIONAL | ||
|(Floating point number) | | (Floating point number) | ||
|Buffer for [[ | | Buffer for [[Point]]s and Lines to make [[Polygon]]s (optional) | ||
| | | | ||
|- | |- | ||
|8 | | 8 | ||
|OPTIONAL | | OPTIONAL | ||
|(SOURCE Integer ID) | | (SOURCE Integer ID) | ||
|[[Source]] (optional) | | [[Source]] (optional) | ||
| | | | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 69: | Line 69: | ||
!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 | Curl example POST | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ { | [ { | ||
| Line 88: | Line 87: | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Curl example multi item POST | Curl example multi item POST | ||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?crs=3857' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d ' | ||
[ { | [ { | ||
| Line 106: | Line 104: | ||
' | ' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
JavaScript example POST | JavaScript example POST | ||
<syntaxhighlight lang="text" copy>var options = { | <syntaxhighlight lang="text" copy>var options = { | ||
method: "POST", | method: "POST", | ||
Latest revision as of 13:01, 19 June 2026
API Endpoint: api/session/event/editormeasure/import_terrains/
Description: Import Measure Terrain Collection
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (GeometryCollection with crs: EPSG:3857) | Collection of Terrain Geometries | |
| 1 | REQUIRED | (Enumeration) | Measure Edit Type | BUILDING, FLATTEN, GEOTIFF, GRID, LEVEE, RAISE, UPGRADE or WATER |
| 2 | REQUIRED | (Boolean or multiple boolean values in array [true, false, true]) | Is Inner | |
| 3 | REQUIRED | (TERRAIN_TYPE Integer ID or multiple integer values in array [1, 2, 3]) | Terrain Type IDs | |
| 4 | REQUIRED | (Floating point number or multiple values in array [1.0, 2.0, 3.0]) | Override Inner Heights | |
| 5 | REQUIRED | (Boolean or multiple boolean values in array [true, false, true]) | Height Relative | |
| 6 | OPTIONAL | (MEASURE Integer ID) | Set for existing Measure ID (optional) | |
| 7 | OPTIONAL | (Floating point number) | Buffer for Points and Lines to make Polygons (optional) | |
| 8 | 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_terrains/?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 ] ] ] ]
} ]
}, "BUILDING", true, 1, 1.0, true ]
'Curl example multi item POST
curl 'https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?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 ] ] ] ]
} ]
}, "BUILDING", [ true, false, true ], [ 1, 2, 3 ], [ 1.0, 2.0, 3.0 ], [ true, false, true ] ]
'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 ] ] ] ] } ]}, "BUILDING", true, 1, 1.0, true ]'
};
fetch("https://engine.tygron.com/api/session/event/editormeasure/import_terrains/?crs=3857", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));