Sign in

Raster calculator

Tool for raster arithmetics over multiband or zipped group of singleband rasters. More info

Form Python-code
You can run this tool via Python.
Go Premium to get a permission token.
import requests

headers = {'Authorization': 'Token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx'}

# Upload files
url = 'https://toolbox.nextgis.com/api/upload/'
files = {}

file = open('...', 'rb')
response = requests.post(url, data=file, headers=headers, verify=False)
files['raster_dataset'] = response.text

# Create request
json_request = {'operation': 'raster_calculator', 'inputs': {}}
json_request['inputs']['raster_dataset'] = files['raster_dataset']
json_request['inputs']['expression'] = ...
json_request['inputs']['output_name'] = ...
json_request['inputs']['x_resolution'] = ...
json_request['inputs']['y_resolution'] = ...
json_request['inputs']['extent'] = ...
json_request['inputs']['data_type'] = ...

# Execute
url = 'https://toolbox.nextgis.com/api/json/execute/'
response = requests.post(url, json=json_request, headers=headers, verify=False)
task_id = response.json()['task_id']

# Check state
url = 'https://toolbox.nextgis.com/api/json/status/{task_id}/'.format(task_id=task_id)
response = requests.get(url, headers=headers, verify=False)
print response.json()