Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for ArcGIS Pro

You're reading from   Python for ArcGIS Pro Automate cartography and data analysis using ArcPy, ArcGIS API for Python, Notebooks, and pandas

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781803241661
Length 586 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
William Parker William Parker
Author Profile Icon William Parker
William Parker
Silas Toms Silas Toms
Author Profile Icon Silas Toms
Silas Toms
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part I: Introduction to Python Modules for ArcGIS Pro
2. Introduction to Python for GIS FREE CHAPTER 3. Basics of ArcPy 4. ArcGIS API for Python 5. Part II: Applying Python Modules to Common GIS Tasks
6. The Data Access Module and Cursors 7. Publishing to ArcGIS Online 8. ArcToolbox Script Tools 9. Automated Map Production 10. Part III: Geospatial Data Analysis
11. Pandas, Data Frames, and Vector Data 12. Raster Analysis with Python 13. Geospatial Data Processing with NumPy 14. Part IV: Case Studies
15. Case Study: ArcGIS Online Administration and Data Management 16. Case Study: Advanced Map Automation 17. Case Study: Predicting Crop Yields 18. Other Books You May Enjoy
19. Index

Walking through a directory to find data

So far, you have been working with single datasets and using ArcPy to do many things that you could do as single tools. The benefit of ArcPy has been in helping you track your tasks and in being able to use Notebooks, which make sharing your analysis easy. However, what about when you have a lot of datasets and need to search through them and organize them, or do analysis on them? This is where the Data Access module comes in.

The first thing to look at in the Data Access module is the walk function, which will allow you to walk through directories.

arcpy.da.Walk

The Python os module is one that you have seen in previous chapters. You have used os.path.join to create a full path of a file from the directory and filename. It also has a walk() function that will walk through a directory tree and find data. This means that you can run it on a folder and be able to walk through all the data, not just within that folder but within the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime