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

Reading data from the CSV file and writing to the feature class


The following steps will help you to read and write data from CSV file to a write to feature class:

  1. The main work of a tool is done inside the execute() method. This is where the geoprocessing of the tool takes place. The execute() method, as shown in the following code, can accept a number of arguments, including the tools self, parameters, and messages:

    def execute(self, parameters, messages):
          """The source code of the tool."""
          return
  2. To access the parameter values that are passed into the tool, you can use the valueAsText() method. Add the following code to access the parameter values that will be passed into your tool. Remember from a previous step that the first parameter will contain a reference to a CSV file that will be imported and the second parameter is the output feature class where the data will be written:

    def execute(self, parameters, messages):
        inputCSV = parameters[0].valueAsText
        outFeatureClass...