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

Exporting the model and adjusting the script

While modeling analysis in ModelBuilder has its drawbacks, there is one fantastic option built into ModelBuilder; the ability to create a model and then export the model to Python. Along with the ArcGIS help documentation, it is the best way to discover the correct Python syntax to use when writing ArcPy scripts.

Create a folder that can hold the exported scripts next to the SanFrancisco geodatabase (for example, C:\Projects\Scripts). This will hold both the exported scripts that ArcGIS automatically generates, and the versions that we will build from those generated scripts.

Open the model called Chapter3Model1 and click on the Model menu in the upper left. Select Export from the menu, and then select To Python Script. Save the script in the script folder as Chapter3Model1.py.

Note

Note that there is also the option to export the model as a graphic. Creating a graphic of the model is a good way to share what the model is doing with other analysts...

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