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 Programming ArcGIS with Python Cookbook, Second Edition
  • Table Of Contents Toc
Programming ArcGIS with Python Cookbook, Second Edition

Programming ArcGIS with Python Cookbook, Second Edition

By : Eric Pimpler
3.6 (8)
close
close
Programming ArcGIS with Python Cookbook, Second Edition

Programming ArcGIS with Python Cookbook, Second Edition

3.6 (8)
By: Eric Pimpler

Overview of this book

The book kicks off with the fundamentals of starting to use Python with ArcGIS, followed by recipes on managing map documents and layers, including how to find and fix broken data links in these files. In the second part of the book, you will learn to create custom geoprocessing tools and how to use the Attribute and Location tools to select specific features. The third part of the book covers topics for advanced users including the REST API, and also teaches you how to use Python with ArcGIS Pro. The book finishes with appendices covering how to automate Python scripts, and the five things that should be at the back of every GIS programmer's mind.
Table of Contents (17 chapters)
close
close
16
Index

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "we have loaded the ListFeatureClasses.py script with IDLE."

A block of code is set as follows:

   import arcpy
   fc = "c:/ArcpyBook/data/TravisCounty/TravisCounty.shp"
   # Fetch each feature from the cursor and examine the extent # properties and spatial reference
   for row in arcpy.da.SearchCursor(fc, ["SHAPE@"]):
     # get the extent of the county boundary
     ext = row[0].extent
     # print out the bounding coordinates and spatial reference
     print("XMin: " + ext.XMin)
     print("XMax: " + ext.XMax)
     print("YMin: " + ext.YMin)
     print("YMax: " + ext.YMax)
     print("Spatial Reference: " + ext.spatialReference.name)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

   import arcpy
   fc = "c:/data/city.gdb/streets"
   # For each row print the Object ID field, and use the SHAPE@AREA
   # token to access geometry properties
   with arcpy.da.SearchCursor(fc, ("OID@", "SHAPE@AREA")) as cursor:
     for row in cursor:
       print("Feature {0} has an area of {1}".format(row[0], row[1]))

Any command-line input or output is written as follows:

[<map layer u'City of Austin Bldg Permits'>, <map layer u'Hospitals'>, <map layer u'Schools'>, <map layer u'Streams'>, <map layer u'Streets'>, <map layer u'Streams_Buff'>, <map layer u'Floodplains'>, <map layeru'2000 Census Tracts'>, <map layer u'City Limits'>, <map layer u'Travis County'>]

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "go to Start | All Programs | ArcGIS | Python 2.7 | IDLE".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Programming ArcGIS with Python Cookbook, Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

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

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon