Book Image

ArcGIS Blueprints

By : Donald Eric Pimpler, Eric Pimpler
Book Image

ArcGIS Blueprints

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

This book is an immersive guide to take your ArcGIS Desktop application development skills to the next level It starts off by providing detailed description and examples of how to create ArcGIS Desktop Python toolboxes that will serve as containers for many of the applications that you will build. We provide several practical projects that involve building a local area/community map and extracting wildfire data. You will then learn how to build tools that can access data from ArcGIS Server using the ArcGIS REST API. Furthermore, we deal with the integration of additional open source Python libraries into your applications, which will help you chart and graph advanced GUI development; read and write JSON, CSV, and XML format data sources; write outputs to Google Earth Pro, and more. Along the way, you will be introduced to advanced ArcPy Mapping and ArcPy Data Access module techniques and use data-driven Pages to automate the creation of map books. Finally, you will learn advanced techniques to work with video and social media feeds. By the end of the book, you will have your own desktop application without having spent too much time learning sophisticated theory.
Table of Contents (18 chapters)
ArcGIS Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

ArcGIS Desktop 10.3 is the leading desktop solution for GIS analysis and mapping. The ArcPy site package, which contains the ArcPy mapping and Data Access modules, enables Python programmers to access all the GIS functionalities provided through ArcGIS Desktop. ArcPy can be integrated with other open source Python libraries to enhance GUI development; create stunning reports, charts, and graphs; access REST web services; perform statistics analysis; and more. This book will teach you how to take your ArcGIS Desktop application development skills to the next level by integrating the functionality provided by ArcPy with open source Python libraries to create advanced ArcGIS Desktop applications.

In addition to working with the ArcPy, ArcPy Mapping, and ArcPy Data Access modules, the book also covers the ArcGIS REST API and a wide variety of open source Python modules, including requests, csv, plotly, tweepy, simplekml, wxPython, and others.

What this book covers

Chapter 1, Extracting Real-Time Wildfire Data from ArcGIS Server with the ArcGIS REST API, describes how to use the ArcGIS REST API with Python to extract real-time wildfire information from an ArcGIS Server map service and write the data to a local geodatabase. A Python Toolbox will be created in ArcGIS Desktop to hold the tools.

Chapter 2, Tracking Elk Migration Patterns with GPS and ArcPy, teaches you how to read a CSV file containing the GPS coordinates of elk migration patterns and write the data to a local geodatabase. The ArcPy mapping module will then be used to visualize time-enabled data and create a series of maps that show the migration patterns over time.

Chapter 3, Automating the Production of Map Books with Data Driven Pages and ArcPy, shows you how to use the Data Driven Pages functionality in ArcGIS Desktop along with the ArcPy mapping module to automate the production of a map book. The use of Python add-ins for ArcGIS Desktop for user interface development will also be introduced.

Chapter 4, Analyzing Crime Patterns with ArcGIS Desktop, ArcPy, and Plotly - Part 1, is the first of two chapters that covers the creation of ArcPy scripts for crime analysis. In this first chapter, you'll learn how to use the Python requests module to extract crime data from the city of Seattle's open database and write to a local geodatabase. You'll then write custom script tools to aggregate the crime data at various geographic levels and create maps that can be printed or exported to a PDF format.

Chapter 5, Analyzing Crime Patterns with ArcGIS Desktop, ArcPy, and Plotly - Part 2, is the second of two chapters that covers the creation of ArcPy scripts for crime analysis. In this chapter, you'll learn how to use the Plotly platform and the Python module to create compelling graphs and charts of crime data that can be integrated into the ArcGIS Desktop layout view for printing and export.

Chapter 6, Viewing and Querying Parcel Data, teaches you how to use the wxPython module to create advanced graphical user interface (GUI) applications for ArcGIS Desktop using Python within the context of an application that queries and views parcel data. Python add-ins for ArcGIS Desktop will also be used in the creation of the application.

Chapter 7, Using Python with the ArcGIS REST API and GeoEnrichment Service for Retail Site Selection, teaches you how to use the ArcGIS Online GeoEnrichment Service with Python to retrieve demographic and lifestyle information to support the site selection process of a new store location. You'll also build tools to interactively select the potential geographic location of stores based on demographic factors.

Chapter 8, Supporting Search and Rescue Operations with ArcPy, Python Add-Ins, and simplekml, teaches you how to build a Search and Rescue (SAR) application that identifies the last known location of the subject, creates search sectors in the support of operations, and exports the data to Google Earth for visualization purposes.

Chapter 9, Real Time Twitter Mapping with Tweepy, ArcPy, and the Twitter API, covers the mining of a live stream of tweets containing specific terms and hash tags. Tweets that contain geographic coordinates will be written to a local geodatabase for further analysis. In addition, several tools will be created to enable the analysis of this social media data. Finally, the results will be shared with the public through the ArcGIS Online service.

Chapter 10, Integrating Smart Phone Photos with ArcGIS Desktop and ArcGIS Online, covers the creation of a real estate application that reads photo metadata, extracts the coordinate information, retrieves the nearest address to the photo, and writes this information to a local feature class. In addition, the photos will be copied to a Dropbox account using the Python Dropbox module so that the photos can be accessed through a web application. Finally, the property feature class will be uploaded to ArcGIS Online, integrated with the Dropbox photos, and shared as a web-based map.

What you need for this book

ArcGIS Blueprints is written for ArcGIS Desktop 10.3. However, ArcGIS Desktop 10.2 can be used for most of the chapters as well. Python 2.7, along with the IDLE development environment, is installed along with ArcGIS Desktop, so no additional installations of Python should be performed. If desired, you can use your preferred Python development environment. I recommend PyScripter if you don't have a preference.

Who this book is for

ArcGIS Blueprints is written for intermediate-level ArcGIS Desktop programmers who wish to take their development skills to the next level. This book will cover intermediate to advanced level ArcGIS Desktop development topics with ArcPy and a variety of open source Python libraries to create applications for a wide array of topics.

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, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The ArcPy data access module that is arcpy.da."

A block of code is set as follows:

def getParameterInfo(self):
    """Define parameter definitions"""
    param0 = arcpy.Parameter(displayName = "ArcGIS Server Wildfire URL", \
                    name="url", \
                    datatype="GPString", \
                    parameterType="Required",\
                    direction="Input")

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

                    parameterType="Required",\
                    direction="Input")
    params = [param0, param1]
    return params

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

# cp /usr/src/asterisk-addons/configs/cdr_mysql.conf.sample
    /etc/asterisk/cdr_mysql.conf

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "You can create a Python Toolbox in a folder by right-clicking on the Folder and navigating to New | Python Toolbox."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ArcGISBlueprints_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.