housekeeping 2. What is ArcPy? 2a. Important ArcPy Considerations: Environments 2b. Important ArcPy Considerations: File Paths 2c. Important ArcPy Considerations: Geodatabases GEOG 315: GIS Programming and Web Mapping Lecture 5 – Arc and Python, together at last
this (even if you don’t think you are) You’ve gone from zero to code in a month (in a class that meets once a week) The remainder of the class will deal with maps, not code syntax.
this (even if you don’t think you are) You’ve gone from zero to code in a month (in a class that meets once a week) The remainder of the class will deal with maps, not code syntax.
wait until the last minute to do this week’s assignments (or really, any week’s assignments) It’s not necessarily that the assignment is super long. There’s just a lot of room for errors, and the concepts are new, so I want to make sure you have time to ask questions.
housekeeping 2. What is ArcPy? 2a. Important ArcPy Considerations: Environments 2b. Important ArcPy Considerations: File Paths 2c. Important ArcPy Considerations: Geodatabases GEOG 315: GIS Programming and Web Mapping Lecture 5 – Arc and Python, together at last
provides a useful and productive way to perform geographic data analysis, data conversion, data management, and map automation with Python.” -ESRI A tiny part of ArcGIS that lets you run ArcGIS tasks with Python code
provides a useful and productive way to perform geographic data analysis, data conversion, data management, and map automation with Python.” -ESRI Sounds cool, how do I use it? import arcpy # on any computer that has ArcMap/Pro installed
provides a useful and productive way to perform geographic data analysis, data conversion, data management, and map automation with Python.” -ESRI Sounds cool, how do I use it? import arcpy # on any computer that has ArcMap/Pro installed # this is the same as import math import random import statistics # in that it provides access to tons of functions
that affect geoprocessing tools. These settings provide a powerful way to ensure geoprocessing is performed in a controlled environment where you decide things such as the processing extent that limits processing to a specific geographic area, a coordinate system for all output datasets, or the cell size of output raster datasets.
that affect geoprocessing tools. These settings provide a powerful way to ensure geoprocessing is performed in a controlled environment where you decide things such as the processing extent that limits processing to a specific geographic area, a coordinate system for all output datasets, or the cell size of output raster datasets. For us, there are some really important environment settings we’ll use often.
important environment settings we’ll use often. pro.arcgis.com/en/pro-app/arcpy/classes/env.htm Whether we want to add processing results to the map automatically
important environment settings we’ll use often. pro.arcgis.com/en/pro-app/arcpy/classes/env.htm What we want the coordinate system of output datasets to be
important environment settings we’ll use often. pro.arcgis.com/en/pro-app/arcpy/classes/env.htm Whether we can name an output file the same thing as an existing file (and not get an error)
important environment settings we’ll use often. pro.arcgis.com/en/pro-app/arcpy/classes/env.htm Where the shapefiles/rasters/feature classes we want to work on are located …and where our outputs will go. THIS ONE IS REALLY, REALLY IMPORTANT
important environment settings we’ll use often. pro.arcgis.com/en/pro-app/arcpy/classes/env.htm Setting the workspace (and other environment settings is easy) …but you’ll forget to do it all the time, and so do I.
settings is easy) …but you’ll forget to do it all the time, and so do I. The first time I run this, life is good. The second time I run this, life isn’t so great.
settings is easy) …but you’ll forget to do it all the time, and so do I. It’s good practice to have these 3 things in the first cell of all your scripts
completely, 100% accurate. Watch your file path for typos…because you won’t know right away! It’ll let you write whatever horribly mangled, typo-ridden thing you want for a workspace…because all it wants is a text string, which this is. …and you won’t realize your mistake until (possibly) way later in your code.
completely, 100% accurate. Watch your file path for typos…because you won’t know right away! CLICK IN HERE TO SHOW PATH THEN COPY/PASTE THIS INTO YOUR CODE
collections of features that share the same geometry type (point, line, polygon) and same attribute fields. Think of these like papers in folders in a file cabinet.
work through an exercise and learn new skills 1. Learn to set environment variables 2. Learn to show the contents of Geodatabases 3. Learn to automate tasks with loops (Clip, Buffer) You’ll demonstrate these skills in homework 1. Clip feature classes 2. Buffer features classes 3. Intersect feature classes and compute areas A single .ipynb notebook (in the Jupyter assignment) A single .ipynb notebook with some text answers (in the homework assignment)