For some applications, you may want more automation than simply using the geoprocessing tools. With some planning, batch files can be used to automatically execute workflow tools with no input from the user.
In this section, try executing example batch files to create source and derived mosaic datasets to create a simplified version of the ArcGIS Online "World Elevation" geodatabase. The first batch file will create a source mosaic dataset each for six elevation datasets; the second batch file will ingest all source mosaic datasets into a single, multiresolution derived mosaic dataset in the same location.
- Open a Windows Explorer window, and navigate to the directory ...\ElevationScripts\elevation\batchfiles\ArcGISPro\.
- Double click the Generate_Source_MD_sample1_ArcGISPro batch file. Click Run if prompted. A Windows Command Prompt will appear as the script to create the source mosaic datasets runs. It may take up to 15 minutes for this script to finish, at which point the Command Prompt will disappear.
- To view your new mosaic datasets, open ArcGIS Pro. Either open your ElevationWorkflow project from the previous section, or under Create a new project, select Map.aptx, name your project something appropriate, like ElevationWorkflow, and click OK.
- Go to the Map tab and select Add Data > Data. Navigate to C:\Image_Mgmt_Workflows\ElevationScript\Elevation\MD\Sample1.gdb, select all six datasets, and click OK.
- Turn off S_WorldZeroElevationBackdrop. For each layer, go to the Appearance tab and turn DRA on-this will ensure your elevation data is rendered so that it's visible.
- Return to the Windows Explorer window with your batch files, and double click the Generate_Derived_MD_sample1_ArcGISPro batch file. Click Run if prompted. Another Command Prompt window will appear. When the process is complete, the Command Prompt will disappear.
- Return to ArcGIS Pro. Add the derived mosaic dataset (...\ElevationScript\Elevation\MD\Sample1.gdb\D_WorldDTM) to your map the same way you added the source mosaic datasets.
- In the Contents pane, right click the D_WorldDTM layer and select Zoom to Layer.
- To apply processing templates, like colorized slope or aspect maps, right click the D_WorldDTM layer, select Properties, and under Processing Templates, use the dropdown Processing Template list to select a template. Click OK to visualize your dataset.
Note:
The results of running the script will be captured in log files written to the …ElevationScripts\elevation\logs\ directory. The log file includes the name of the created mosaic dataset and the date and time it was created.You have now used sample batch files to create source and derived mosaic datasets, with user-selectable raster function templates attached, to better manage your elevation data. In the next section, you'll look at how to adapt these tools to your own datasets.