Api session event editor measure import grids
API Endpoint: editormeasure/import_grids.
API Endpoint name is Api session event editor measure import grids.
Use this endpoint to Import Measure Grid Collection
| 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 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));