Sign in

Join layer and table by field

A tool to combine data from two sources: spatial data of a web GIS layer and tabular data. Joining can be done in two modes: one-to-one or one-to-many. Подробнее

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['src'] = response.text

# Create request
json_request = {'operation': 'join_by_field', 'inputs': {}}
json_request['inputs']['web_gis'] = ...
json_request['inputs']['resource_id'] = ...
json_request['inputs']['src'] = files['src']
json_request['inputs']['id_json'] = ...
json_request['inputs']['id_csv'] = ...
json_request['inputs']['join_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()