Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Donald Eric Pimpler, Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

Table of Contents (22 chapters)
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using FieldMap and FieldMappings


Up until this point in the chapter, we've covered how to use Python with the ArcGIS REST API to access ArcGIS Server services. Now, we're going to switch gears and go back into the ArcPy module and discuss the FieldMap and FieldMappings classes.

Getting ready

A common GIS operation is to merge several disparate datasets into a single dataset of a larger area. Often, the fields in the datasets to be merged will be the same and there won't be any problems. However, there will be times when the fields of the various datasets do not match. In this case, you will need to map the relationship between fields in one dataset to fields in another dataset.

The preceding diagram displays the relationship between the various ArcPy classes that are used to define field mapping. A FieldMap object contains a field definition and a list of input fields from one or more tables, or feature classes that provide the values for the field. Each FieldMap object that you create is then...