We released ArcGIS Enterprise 10.9.1 (Windows and Linux) on November 18, 2021. In this release, an exciting new feature for ArcGIS Notebook Server is the ability to publish notebooks as web tools.
Use cases
Some use cases of notebook web tools include (but are not limited to) the following:
- Publish a notebook as a web tool to take advantage of client applications that know how to work with geoprocessing services. For example, you can configure a Geoprocessing widget in ArcGIS Web AppBuilder with a notebook web tool that extends the existing widget functionalities, such as a web tool that buffers a clicked point and returns summary statistics of the features within that buffer.
- Publish a notebook that you have authored and tested as a web tool so other users of the ArcGIS platform who have notebook privilege can easily consume it. For instance, you can create a data cleaning notebook that removes missing values, formats attribute names, and recalculates the extent of the input feature layer. Other users who are not familiar with Python or data engineering can leverage this web tool to clean their feature layer.
- Author a notebook once but have it callable via various workflows as a notebook web tool. A sample scenario is a conservation group requiring all vegetation layers styled with a specific color, transparency, and outline, and configured with the same icon and format on the pop-up. You can create a notebook web tool that applies the required styles and pop-ups to the input layer and calls the web tool when there is a new vegetation layer.
We look forward to seeing how you will use notebook web tools in your workflows! To help get you started, here is a step-by-step example of how to publish a notebook web tool.
Example
In this example, we create a web tool that creates and compares two market areas—a buffer and a drive-distance-based area—for a local business.
When we say a 1-mile market area from a point, it could mean a 1-mile circular buffer, or it could also refer to the area that can be reached within 1 mile by driving, biking, walking, and so on. The two types of 1-mile areas can look very different based on the location of the input point and the structure of the underlying road network. Businesses that make strategies based on distance may want to understand the difference between the two areas. Therefore, we will create a web tool that easily visualizes this difference.
The flow chart below demonstrates how the notebook web tool should work.
Screen record
Note: Some processing times in the video are speeded-up for demonstration purposes.
As shown in the video, here are the steps to create the notebook web tool:
- Build a notebook with the Python code for your web tool (00:00:05).
- In the Parameters pane, add the input parameters for your web tool (00:00:12).
- Insert the input parameters as variables to your notebook (00:00:54). Then, run the notebook to check that the variables are processed as expected (00:01:05).
- Add the output parameters and insert them at the end of the notebook (00:01:36).
-
- Tip 1: Print your FeatureSet output to efficiently acquire the default parameter value (00:01:12).
- Tip 2: You can also specify the default value of input and output FeatureSets as a URL. See the “Layer URL syntax” section on this page for details.
-
- Finally, save the notebook and publish the web tool (00:02:12).
You can run the web tool in Map Viewer Classic (00:02:35; this will be available in a future release of Map Viewer), with the Geoprocessing widget in Web AppBuilder (00:03:13), or in your customized apps!
We hope this is helpful. Let us know what kind of notebooks you publish as web tools or if you have any questions in the ArcGIS Notebooks Community.
Article Discussion: