sets 3. An introduction to toolboxes, this week’s topic 1. Quick review of format strings GEOG 315: GIS Programming and Web Mapping Lecture 11 – Selection Sets Reviewed, and Toolboxes
Selection Sets Reviewed, and Toolboxes 1. Quick review of format strings The format() method formats the specified value(s) and insert them inside the string's placeholder. The placeholder is defined using curly brackets: {}. Even better, use {0} and {1}’s:
format() function… Not in the format string itself, because strings can’t have math in them: Even better, do your math outside the format line entirely
Wouldn’t it be nice to make your own toolbox that used a DEM as input and produced a watershed polygon as output? Yes, yes it would. Because then you’d just have to provide your DEM and hit “Go”. There are two ways to do this: 1. Write some Python code that runs on its own (i.e., a python script) and then have ArcPro convert it to a Toolbox for you. 2. Write some Python code in a format that ArcPro recognizes and just upload it into ArcPro directly. This way’s simpler, but toolboxes can get corrupted. This way is safer – the only way the toolbox breaks is if your code changes (and you can always fix that). This week, we’ll create some custom toolboxes in ArcPro.
Problems Two Homework Problems 1. Write a Python script that does some geoprocessing 2. Turn your Python script into a toolbox in ArcPro Two Demo Markdown Files for Comprehension 1. Making toolboxes with scripts 2. Making toolboxes with Python code Read homework.md carefully to see what to turn in! Turn these in for this week’s Jupyter assignment Turn these in for this week’s Homework assignment