Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying ArcPy and ArcGIS: Geospatial Analysis with Python
  • Table Of Contents Toc
  • Feedback & Rating feedback
ArcPy and ArcGIS: Geospatial Analysis with Python

ArcPy and ArcGIS: Geospatial Analysis with Python

By : Silas Toms
3.9 (11)
close
close
ArcPy and ArcGIS: Geospatial Analysis with Python

ArcPy and ArcGIS: Geospatial Analysis with Python

3.9 (11)
By: Silas Toms

Overview of this book

If you are a GIS student or professional who needs an understanding of how to use ArcPy to reduce repetitive tasks and perform analysis faster, this book is for you. It is also a valuable book for Python programmers who want to understand how to automate geospatial analyses.
Table of Contents (14 chapters)
close
close
13
Index

Creating a Python module

An important step towards creating reusable code is to package its component functions into a module that can be called from the Python path by any script. To start, we need to create a folder in the site-packages folder where Python modules are placed when downloaded and extracted using the Python module process, or when running the setup.py script included with shared modules.

Modules package together functions in one or more scripts into a folder that can be shared with others (though they often depend on other modules to run). We have used some of the built-in modules such as the csv module and third-party modules such as ArcPy. Let's explore their construction to get a feel of how a module is packaged for use and sharing.

Note

Many modules are not placed within the site-packages folder, but they require the Python path to be modified to make them importable. Placing modules within the site-packages folder eliminates this requirement.

Open up the site-packages...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY