O'Reilly logo

ArcPy and ArcGIS – Geospatial Analysis with Python by Silas Toms

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Complex ArcPy Scripts and Generalizing Functions

In this chapter, we will move from creating simple scripts based on autogenerated scripts from ModelBuilder to complex scripts that incorporate advanced Python and ArcPy concepts, such as functions. Functions can improve code and save time when writing scripts. They are also useful when creating modules or other reusable code, allowing for standard programming operations to be scripted and ready for future use.

In this chapter, will cover the following topics:

  • Creating functions to avoid repeating code
  • Creating helper functions to work with ArcPy limitations
  • Generalizing functions to make them reusable

Python functions–Avoid repeating code

Programming languages share a concept that has aided ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required