Lab 8: Web Geoprocessing Services

Introduction: 

This lab gave students experience in developing a very basic geoprocessing service. Instead of requiring scripting using the ArcGIS API for JavaScript and the use of HTML and CSS as past labs have, this lab leveraged the simplicity of authoring a geoprocessing application with the Web AppBuilder for ArcGIS Developer Edition. A geoprocessing service was created using the Model Builder within ArcMap and other ArcMap functions which was then used by the geoprocessing widget employed in the Web AppBuilder application. The goal was to create an application which could find areas suitable for a factory. This factory requires water and therefore needs to be close to a river, needs rail transport for bulky final products so it needs to be close to railroads, and needs to be close to a city of more than 4000 people for the workforce to withdraw to. The CEO also would like to have the latitude to enter different population requirement parameters into the application.

Methods:

Part 1 Section 1:

Part 1 Section 1 required the building of the geoprocessing model in model builder, before exporting the model as a python script. The model was created by right clicking on a new geodatabase and clicking new toolbox, then right clicking on this new toolbox and creating a new model. The new model was then opened for editing, and the three supplied feature classes (Rivers, Railroads, and Wisconsin_Cities) were brought into the model. Appropriate tools were dragged into the model, inputs and outputs were named accordingly, and the data flow was constructed with the connect tool, always paying close attention to connect as the right geoprocessing tool parameter. Some tools used in the model were specified model parameters and these were the inputs (specified in their names) that the model used to come to it's final optimal factory locations polygon. A point layer feature template was created for the input location of interest point. The model is shown below in Figure 1, the model parameters shown with a small P to the top right of the element. The model, opened from the toolbox created in the catalog window, can be seen in Figure 2, and this view also shows the model parameters.
Figure 1

Figure 2
The model makes a buffer of the distance parameter set from the input area of interest. It then uses this point buffer to clip the railroads, cities, and rivers down to this area of interest. Buffers are then created with the distance to railroads and rivers input parameters taken into consideration. The railroads and rivers buffers are intersected, and the selected cities based on the population value input are spatially joined to the railroads and rivers intersect output. The boundaries are then dissolved and the final polygon shapefile output for optimal factory locations is created.

Part 1 Section 2:

This section had students validate and run the model for testing in ArcMap. A python script was then exported from the ModelBuilder editing window for future use in the web application.

Part 1 Section 3:

In this section the geoprocessing service was published by opening the results window of the test of the geoprocessing tool and right clicking on the tool. The service was published to the local REST endpoint in asynchronous execution mode.

Figure 3


Part 2 Section 1:

Using Web AppBuilder for ArcGIS Developer Edition running on a desktop, a new 2D application was created. After adding a web map with the railroads, rivers, and cities data, a geoprocessing widget was added as Widget 1. This widget was then configured to take inputs from the user for the model parameters, defaulting on the set defaults for the model parameters. The widget also was configured with the rest endpoint of the geoprocessing service task URL.

Part 2 Section 2:

In this section, the application files were copied from the local drive used to develop within Web AppBuilder for ArcGIS Developer Edition to the internally available deployment server.


Results:

The result of this lab is a deployed application which may be used to find suitable factory locations. Parameters for the tool are editable so a user may decide which parameters to enter, or to use the default parameters.When one sets a point of interest in the geoprocessing widget, the point is shown on the map as a purple circle. The areas returned by the server are shown in yellow. Figures 4-6 show this process. As this is an asynchronous execution mode geoprocessing application, the status of the processing is shown.

Figure 4


Figure 5


Figure 6

Sources:

Rivers data was sourced from the USGS National Hydrograph Dataset.

Comments

Popular posts from this blog

Lab 3: Web AppBuilder for ArcGIS

Lab 7: Volunteered Geographic Information

Lab 6: ArcGIS API for JavaScript 2: Mobile responsive apps