Get the very most out of the ArcGIS for Desktop products through ArcObjects and .NET ArcGIS for Desktop is a powerful suite of software tools for creating and using maps, compiling, analyzing and sharing geographic information, using maps and geographic information in applications, and managing geographic databases. But getting the hang of ArcGIS for Desktop can be a bit tricky, even for experienced programmers. Core components of ArcGIS platform is called ArcObjects. This book first introduce you the whole ArcGIS platform and the opportunities for development using various programming languages. Then it focuses on ArcGIS for Desktop applications and makes you familiar with ArcObjects from .NET point of view. Whether you are an ArcGIS user with no background in programming or a programmer without experience with the ArcGIS platform, this book arms you with everything you need to get going with ArcGIS for Desktop development using .NET right away. Written by a leading expert in geospatial information system design and development, it provides concise, step-by-step guidance, illustrated with best-practices examples, along with plenty of ready-to-use source code.
In no time you'll progress from .NET programming basics to understanding the full suite of ArcGIS tools and artefacts to customising and building your own commands, tools and extensions all the way through application deployment. Among other things, you'll learn to: Object-Oriented and Interface-based programming in .NET (C# and VB.NET) Finding relationship between classes and interfaces using object model diagrams Querying data Visualizing geographical data using various rendering Creating various kinds of Desktop Add-Ins Performing foreground and background geoprocessing Learn how to improve your productivity with ArcGIS for Desktop and Beginning ArcGIS for Desktop Development Using .NET
Pouria Amirian holds a Ph.D. of Geospatial Information Systems (GIS). Dr. Amirian is a developer and GIS/IT lecturer with extensive experience developing and deploying small to large-scale Geospatial Information Systems. Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that guides you through all the techniques involved.
INTRODUCTION xxi PART I: THE BASICS CHAPTER 1: WHY GEOSPATIAL IS SPECIAL 3 A Tour of Geospatial Data 4 Why Geospatial Is Special 8 Various Kinds of GIS Software 10 Server GIS 11 Desktop GIS 13 Developer GIS 17 Mobile GIS 18 Geospatial Data Models and Storage 19 Raster 19 Vector 20 Geospatial Data as Text or Binary File 20 Geospatial Data in Georelational Models 21 Geospatial Data Inside Spatial DBMS 21 Geospatial Data in XML Structures 23 Esri Geodatabase 30 Personal Geodatabase 30 File Geodatabase 30 ArcSDE Geodatabase 31 Summary 32 CHAPTER 2: INTRODUCTION TO ARCGIS FOR DESKTOP APPLICATIONS CUSTOMIZATION 35 Four Ways to Customize ArcGIS for Desktop 36 Customizing the User Interface 37 Scripting 41 Desktop Add-Ins 48 ArcObjects SDK 55 Summary 59 PART II: .NET PROGRAMMING FUNDAMENTALS CHAPTER 3: .NET PROGRAMMING FUNDAMENTALS, PART I 63 The .NET Framework 63 The C# Language 64 A Brief History of C# 64 Basic Concepts 65 Variables and Data Types 66 Nullable Data Types 71 Operations on Variables 71 Arrays 75 Decision-Making 76 Iteration 78 Object Manipulation 81 Data Type Conversion 83 Enumerations 85 Methods 89 Introduction to Object-Oriented Programming in C# 93 Object-Oriented Programming in Action 94 Defi ning Properties 96 Defi ning Methods 98 Defi ning Constructors 98 Summary 100 CHAPTER 4: .NET PROGRAMMING FUNDAMENTALS, PART II 103 Overview of Object-Oriented Programming Concepts 104 Abstraction 104 Encapsulation 104 Inheritance 105 Polymorphism 106 Reference Types and Value Types 108 Assignment Operations 108 Comparison Operations 109 Passing Parameters between Method Calls 109 Brief Explanation of All .NET Types 111 Namespaces and Assemblies 112 Debugging Using Visual Studio 113 Structured Exception Handling 117 Casting Objects 120 Aggregation Using Collections 121 The ArrayList 122 Generics 123 Reading and Writing Files 123 Summary 135 PART III: ARCOBJECTS PROGRAMMING CHAPTER 5: UNDERSTANDING ARCOBJECTS OBJECT MODEL DIAGRAMS 139 What Is ArcObjects? 140 Interface-Based Programming in Brief 140 Understanding Object Model Diagrams 144 Types of Classes in ArcObjects 145 Relationships between Classes 147 Members of Interfaces 149 Interface Inheritance 151 Wormhole 153 Additional Tips for Using Object Model Diagrams 153 Where to Start with ArcObjects 155 How to Find an Associated Member 156 Summary 163 CHAPTER 6: ACCESSING MAPS AND LAYERS 165 Introduction to Maps and Layers In ArcObjects 165 General Properties of All Layers 175 Working with FeatureLayers 179 Working with RasterLayers 183 Adding an Existing *.lyr File to a Map 184 Adding *.lyr Files Using GxDialog 186 Saving *.lyr and *.mxd Files 191 Summary 194 CHAPTER 7: WORKING WITH TABLES AND FEATURECLASSES 197 Accessing Tables and FeatureClasses 197 Adding and Deleting Fields 204 Adding Existing FeatureClasses, Tables, and Rasters to a Map 207 Deleting an Existing FeatureDataset, FeatureClass, Table, or Raster 215 Creating Tables and Rows 215 Summary 225 CHAPTER 8: SUBSETS OF RECORDS 227 Using Object Model Diagrams for Selecting Features and Rows 228 Working with Existing Selections 229 Selecting Rows and Features 233 Accessing a Subset of Records 237 Simple Statistics of Features 245 Some Important Points about Using Cursors 251 Displaying Subsets of Geospatial Data 254 Summary 255 CHAPTER 9: CONSTRUCTING AND USING THE GEOMETRY OF FEATURES 257 Object Model Diagram for the Geometry of Features and Graphics 258 Displaying Geometries on the Screen 260 Creating and Drawing Points 261 Creating and Drawing Multipoints 264 Creating and Drawing Polylines 268 Creating and Drawing Polygons 272 Creating a New Feature and Editing an Existing Feature's Geometry 276 Working with Spatial Operators 281 Examining Spatial Relationships 281 Common Geoprocessing Operations 284 Determining the Nearest Points and Distance 287 Length, Area, Centroid, and Envelope of Geometries 292 Summary 293 CHAPTER 10: RENDERING GEOSPATIAL DATA AND USING HYPERLINKS AND MAPTIPS 295 Geospatial Data Display 296 Color and ColorRamp Classes 296 Symbols 298 Renderers for Vector and Raster Geospatial Data 300 Going beyond Simple Display 318 Simple and Advanced MapTips 319 Hyperlinks 321 Summary 324 CHAPTER 11: LABELING, EXPORTING ACTIVEVIEW, AND WORKING WITH ELEMENTS 327 Labeling 328 Labeling with the Default Labeling Engine 329 Labeling with the Maplex Labeling Engine 334 Exporting the ActiveView 336 Working with Elements 346 Adding GraphicElements 348 Adding FrameElements 352 Summary 361 CHAPTER 12: GEOPROCESSING WITH TOOLS AND MODELS 365 ArcObjects and the Geoprocessing Framework 365 Running Geoprocessing Tools 366 Running Custom Tools 375 Opening a Tool's Dialog Box in Code 384 Geoprocessing in the Background 389 Bach Processing 397 Can I Manage the Execution of Geoprocessing Tools? 399 Summary 400 CHAPTER 13: FEATURE DATA MANAGEMENT 403 Use of GUID in ArcObjects 404 Working with the Geodatabase Model 406 Creating Geodatabases 407 Creating FeatureDatasets and FeatureClasses 408 Working with Features 418 Creating New Features 418 Modifying Existing Features 422 Summary 426 CHAPTER 14: ADVANCED TOPICS IN ARCOBJECTS PROGRAMMING AND DEPLOYMENT 429 Sharing State and Functionality between Components 430 Event Handling in ArcObjects 432 Application Extension 435 Add-In Deployment 450 Preparing for Release 450 Add-In File Structure 452 Distributing and Installing an Add-In 453 Custom Component Deployment 456 Creating an Installer for Custom Component 459 Summary 465 APPENDIX: ANSWERS TO CHAPTER EXERCISES 467 INDEX 479