Skip to content
URL:
https://<root>/services/types/customrasterfunctions/register
Methods:
POST
Version Introduced:
11.5

Description

The register operation registers a custom raster function with an organization. This operation requires uploading a .zip file that contains at least one Python file (.py) and the raster function template file (either a rft.xml or a rft.json file format). While the .zip file may only contain one raster function template, multiple Python files can be included in the .zip file. If multiple Python files are included in the .zip file, only the main Python file needs to be referenced in the raster function template. As well, the main Python file and the raster function template file must have the same name.

When registered successfully, a raster function portal item is created. The item ID is the same as the raster function ID returned by the Custom Raster Functions and Raster Function endpoints. The name of the portal item will be the same as the name of the raster function template.

This operation will fail if a developer attempts to upload and register a raster function template that has the same name as an already registered raster function. If the organization has a number of deployed custom raster functions, it is recommended to first perform the Find operation to determine if a raster function of the same name has already been registered.

Request parameters

ParameterDetails

customRasterFunctionZipFile

(Required)

A .zip file containing at least one Python file and the raster function template with a file format of either rft.xml or rft.json. If multiple Python files are included in the .zip file, only the main Python file needs to be referenced in the raster function template. As well, the main Python file and the raster function template file must have the same name.

description

(Optional)

A user-provided description of the raster function. If a description is provided, it becomes the item description for the raster function portal item.

Example usage

The following is a sample POST request for the register operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
POST /<context>/services/types/customrasterfunctions/regiter HTTP/1.1
Host: organization.example.com
Content-Type: multipart/form-data; boundary=------boundary


------boundary
Content-Disposition: form-data; name="customRasterFunctionZipFile"; filename=""
Content-Type: application/octet-stream

HeatIndex.zip
------boundary
Content-Disposition: form-data; name="description"

This function computes heat index information.
------boundary
Content-Disposition: form-data; name="token"

ZSQdguIKc3G6kJGm2WlvAaBmCO9yvdtebnd9KP5zbP5_dQlCSJ1jejEdlYPn4IborV1gO2_0aqSe-7dy9D7pEDWFphiO22yGMUNPSEvX61vy6VZrBxjZ7pDB8MLkD3U9YYR5rR4TjN1WM6qJubaBHAozC8WaA9nchSMtREnfNet5xfqhyzruScNNYuz37JyJbhjCSq9T7azYgQpiDfCUupTFVN9O-XY66PtEOtlRDpMDq13BSqRRgvg6-kI7uLwQ
------boundary

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.