From the course: Learning ArcGIS Python Scripting
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Properties of layers - ArcGIS Pro Tutorial
From the course: Learning ArcGIS Python Scripting
Solution: Properties of layers
(upbeat music) - [Instructor] Okay, how was that? Hopefully it wasn't too hard for you. It brings in a lot of the things that we've learned so far in the course. Let me show you how I did it. But your code could look different from mine, and that's totally fine. As we've talked about before, there are lots of ways to accomplish things with code, but here's what I did. I imported ArcPy, then I created my project object. I do that with aprx equal ArcPy.mp.ArcGISProject, and I'm using the current keyword, again, for the current project. We've done this many times in the course. It's such a common thing. You'll probably want to have this code somewhere in a little text file that you can just paste in whenever you need it. Next, I'll instantiate the map object. I'll do that with listMaps. I'll search for just the Baytown map, and I'll pull off the first one in case there happened to be two named Baytown in the project, which there's not in our project. Next, I'll create the list of layers…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Working with lists6m 18s
-
(Locked)
List methods and functions8m 48s
-
(Locked)
Use loops to work with lists7m 50s
-
(Locked)
Write a script using list methods and a for-loop3m 39s
-
(Locked)
Nested loops8m 16s
-
(Locked)
Conditional statements7m 35s
-
(Locked)
Write a script using ArcGIS API10m 31s
-
(Locked)
Getting to the properties of GIS data with Describe3m 28s
-
(Locked)
Challenge: Properties of layers37s
-
(Locked)
Solution: Properties of layers3m 4s
-
(Locked)
-
-
-
-