ebook img

ArcGIS Desktop Developer Guide - Esri Support Info PDF

340 Pages·2004·3.95 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ArcGIS Desktop Developer Guide - Esri Support Info

ArcGIS® Desktop Developer Guide ArcGIS® 9.1 PUBLISHED BY ESRI 380 New York Street Redlands, California 92373-8100 Copyright © 2004 ESRI UUUUU.....SSSSS..... GGGGGOOOOOVVVVVEEEEERRRRRNNNNNMMMMMEEEEENNNNNTTTTT RRRRREEEEESSSSSTTTTTRRRRRIIIIICCCCCTTTTTEEEEEDDDDD/////LLLLLIIIIIMMMMMIIIIITTTTTEEEEEDDDDD RRRRRIIIIIGGGGGHHHHHTTTTTSSSSS All rights reserved. Any software, documentation, and/or data delivered hereunder is Printed in the United States of America. subject to the terms of the License Agreement. In no event shall the U.S. Government acquire greater than RESTRICTED/LIMITED RIGHTS. The information contained in this document is the exclusive property of At a minimum, use, duplication, or disclosure by the U.S. Government is ESRI. This work is protected under United States copyright law and subject to restrictions as set forth in FAR §52.227-14 Alternates I, II, and other international copyright treaties and conventions. No part of this III (JUN 1987); FAR §52.227-19 (JUN 1987) and/or FAR §12.211/12.212 work may be reproduced or transmitted in any form or by any means, (Commercial Technical Data/Computer Software); and DFARS electronic or mechanical, including photocopying and recording, or by any §252.227-7015 (NOV 1995) (Technical Data) and/or DFARS §227.7202 information storage or retrieval system, except as expressly permitted in (Computer Software), as applicable. Contractor/Manufacturer is ESRI, writing by ESRI. All requests should be sent to Attention: Contracts 380 New York Street, Redlands, California 92373-8100, USA. Manager, ESRI, 380 New York Street, Redlands, California 92373-8100, USA. ESRI, ArcView, ArcIMS, SDE, the ESRI globe logo, ArcGlobe, ArcReader, ArcPad, ArcScan, ArcObjects, ArcGIS, ArcMap, ArcCatalog, ArcScene, The information contained in this document is subject to change without ArcInfo, ArcEdit, ArcEditor, ArcToolbox, 3D Analyst, ArcPress, ArcSDE, notice. GIS by ESRI, the ArcGIS logo, and www.esri.com are trademarks, registered trademarks, or service marks of ESRI in the United States, CCCCCooooonnnnntttttrrrrriiiiibbbbbuuuuutttttiiiiinnnnnggggg WWWWWrrrrriiiiittttteeeeerrrrrsssss the European Community, or certain other jurisdictions. Euan Cameron, Rob Elkins, Shelly Gill, Sean Jones, Allan Laframboise, Glenn Meister, Steve Van Esch Other companies and products mentioned herein are trademarks or registered trademarks of their respective trademark owners. Attribution.pmd 1 1/26/2005, 7:02 AM Contents CHAPTER 1: INTRODUCING ArcGIS DESKTOP DEVELOPMENT.............. 1 ArcGIS 9 developer overview..........................................................................................................2 ArcGIS Desktop developer overview.............................................................................................6 Using this guide.................................................................................................................................10 ArcGIS developer resources..........................................................................................................12 CHAPTER 2: ArcGIS SOFTWARE ARCHITECTURE...........................................17 ArcGIS software architecture.......................................................................................................18 ArcGIS application programming interfaces.............................................................................23 ArcGIS Engine libraries....................................................................................................................25 ArcGIS Desktop application libraries..........................................................................................33 CHAPTER 3: DEVELOPING FOR ArcGIS DESKTOP APPLICATIONS.......45 Customizing ArcGIS Desktop.......................................................................................................................... 46 Storing customizations....................................................................................................................49 Customizing ArcGIS Desktop applications with VBA.............................................................53 Component development..............................................................................................................64 Choosing a component development environment..............................................................67 Building an ArcGIS Desktop component...................................................................................68 CHAPTER 4: LICENSING AND DEPLOYMENT...................................................73 ArcGIS Desktop license checking.................................................................................................74 Packing and deploying customizations.......................................................................................86 CHAPTER 5: DEVELOPER SCENARIOS...................................................................93 Create a toolbar: Command, Tool, and Menu...........................................................................94 Extensions.........................................................................................................................................114 Dockable window...........................................................................................................................120 APPENDIX A: DEVELOPER ENVIRONMENTS.................................................. 133 The Microsoft Component Object Model.............................................................................134 Developing with ArcObjects........................................................................................................146 The Visual Basic 6 environment..................................................................................................155 Visual Basic for Applications........................................................................................................168 The Visual Basic 6 development environment........................................................................174 Visual C++................................................................................................................................................................ 181 .NET Application Programming Interface............................................................................................. 223 TOC.pmd 3 1/26/2005, 7:37 AM APPENDIX B: READING THE OBJECT MODEL DIAGRAMS.....................265 Interpreting the object model diagrams...................................................................................266 APPENDIX C: ILLUSTRATED CODE SAMPLES................................................269 Locate and execute command on toolbar.............................................................................271 Draw digitized line onscreen.......................................................................................................272 Add feature class to ArcMap.......................................................................................................274 Add layer to ArcMap using GxDialog.......................................................................................276 Style gallery auto symbol selection............................................................................................278 Loop through selected area features........................................................................................280 Spatial query.....................................................................................................................................282 Add map surround to page layout............................................................................................284 Add text callout to active view..................................................................................................286 Geometry projection.....................................................................................................................288 Display raster cell value in status bar........................................................................................290 Export current view......................................................................................................................292 Print current view..........................................................................................................................294 Display map extent in GxView as envelope...........................................................................296 Edit feature class schema..............................................................................................................298 APPENDIX D: ArcObjects PROBLEM-SOLVING GUIDE .............................301 ArcObjects problem-solving guide............................................................................................302 APPENDIX E: UIControls............................................................................................319 UIControl classes............................................................................................................................320 UIButtonControl class..................................................................................................................321 UIComboBoxControl class.........................................................................................................322 UIEditBoxControl class................................................................................................................323 UIToolControl class.......................................................................................................................324 APPENDIX F: BIBLIOGRAPHY.................................................................................325 INDEX .................................................................................................................................329 iv • ArcGIS Desktop Developer Guide TOC.pmd 4 1/26/2005, 7:37 AM 11111 Introducing ArcGIS Desktop development The ESRI® ArcGIS® Desktop Developer Guide is an introduction for anyone who wants to customize or extend ArcGIS Desktop applications, such as ArcMap™ or ArcCatalog™. This chapter introduces the ArcGIS Desktop development environment in the context of the ArcGIS product family. Topics covered in this chapter include an ArcGIS 9 developer overview, an ArcGIS Desktop developer overview, using this guide, and ArcGIS developer resources. 1 Ch01-Intro.pmd 1 1/26/2005, 7:03 AM ARCGIS 9 DEVELOPER OVERVIEW ArcGIS 9 is an integrated family of geographic information system (GIS) soft- ware products for building a complete GIS. It is based on a common library of shared GIS software components called ArcObjects™. ArcGIS 9 consists of four key parts: • Desktop GIS, an integrated suite of advanced GIS applications. (cid:127) Embedded GIS, embeddable GIS component libraries for building custom applications using C++, COM, .NET, and Java™. (cid:127) Server GIS, a shared library of GIS software objects used to build server-side GIS applications in enterprise and Web computing frameworks. Used for building both SOAP-based Web services and Web applications using .NET/ ASP and Java/JSP. (cid:127) Mobile GIS, GIS Web services to publish maps, data, and metadata through open Internet protocols. ArcSDE® Gateway is an interface for managing geodatabases in numerous rela- tional database management systems (RDBMSs). 2 (cid:127) ArcGIS Desktop Developer Guide Ch01-Intro.pmd 2 1/26/2005, 7:03 AM ARCGIS 9 DEVELOPER OVERVIEW ArcGIS provides a scalable framework for implementing GIS for a single user or for many users on desktops and servers. This book will be of greatest use to developers who want to use the ArcGIS Desktop Developer Kit to customize and extend the ArcView®, ArcEditor™, or ArcInfo® desktop products. This book provides a general explanation of the options and opportunities available to developers with ArcGIS Desktop. Several scenarios will illustrate with code examples the different types of customization that can be developed with the ArcGIS Desktop Developer Kit. ArcGIS is a platform for building geographic information systems. ArcGIS 9 will extend the system with major new capabilities in the areas of geoprocessing, 3D visualization, and developer tools. ArcGIS Engine and ArcGIS Server, developer- centric products, make ArcGIS a complete system for application and server development. There is a wide range of possibilities when developing with ArcGIS, including the following: • Configure/Customize ArcGIS applications, such as ArcMap and ArcCatalog. (cid:127) Extend the ArcGIS architecture and data model. (cid:127) Embed maps and GIS functionality in other applications with ArcGIS Engine. (cid:127) Build and deploy custom desktop applications with ArcGIS Engine. (cid:127) Build Web services and applications with ArcGIS Server. ArcGIS 9 has a common developer experience across all ArcGIS products (Engine, Server, and Desktop). This book focuses on customizing and extending the ArcGIS Desktop applications. Developers wanting to build custom standalone applications or work with ArcGIS Server should refer to the ArcGIS Engine Developer Guide and the ArcGIS Server Administration and Development Guide, respectively. ArcGIS The ArcGIS system is built and extended using ArcObjects Engine software components. ArcObjects includes a wide variety of programmable c omponents, ranging from fine-grained objects (for example, individual geometry objects) to coarse-grained ArcGIS objects (for example, a map object to interact with existing Server ArcMap documents), which aggregate comprehensive GIS functionality for developers. Developers work with ArcObjects using standard program- ming frameworks to extend ArcGIS Desktop, build custom applications with ArcGIS Engine, and implement server GIS ArcObjects applications for various enterprise purposes using ArcGIS ArcGIS Server. Desktop Chapter 1 (cid:127) Introducing ArcGIS Desktop development (cid:127) 3 Ch01-Intro.pmd 3 1/26/2005, 7:03 AM ARCGIS 9 DEVELOPER OVERVIEW Each of the ArcGIS product architectures built with ArcObjects represents alternative application development containers for GIS software developers, including desktops, embeddable engines, and servers. ARCGIS SOFTWARE DEVELOPER KITS The ArcGIS Engine, Server, and Desktop have software developer kits (SDK) for working with ArcObjects. The developer kits provide everything needed to be successful with ArcObjects, including developer documentation, samples, and object model diagrams. ArcGIS 9 Desktop GIS Embedded GIS Server GIS Mobile GIS ArcGIS Desktop ArcGIS Engine ArcGIS Server ArcIMS ArcGIS Mobile ArcPad ArcView ArcEditor Web Desktop Custom ArcInfo ArcReader Applications Server CWusetobm Te Tmemplpaltaetses + ArcGIS Extensions Desktop Engine Server Mobile Developer Kit Developer Kit Developer Kits Developer Kit ADF Developer Kit Server Developer Kit .NET COM .NET C++ COM Java Java ADF .NET ADF .NET COM Java PEI Compact Framework ArcObjects Component Building Blocks ArcSDE Geodatabase File-based DBMS XML The ArcGIS Desktop Developer Kit ArcGIS Desktop includes a series of Windows® desktop application frame- works—ArcMap, ArcCatalog, ArcToolbox™—and more, each with user inter- face (UI) components. ArcGIS Desktop is available at three functional levels (ArcView, ArcEditor, and ArcInfo) and can be customized and extended using the ArcGIS Desktop Developer Kit. The ArcGIS Desktop Developer Kit is included with ArcView, ArcEditor, and ArcInfo and supports the COM and .NET programming frameworks. Many users apply the ArcGIS Desktop Developer Kit to add extended functions, new GIS tools, custom user interfaces, and full extensions for improving professional GIS productivity of ArcGIS Desktop. The ArcGIS Engine Developer Kit ArcGIS Engine is a simple, application-neutral programming environment for ArcObjects. The ArcGIS Engine Developer Kit is a separate product that pro- vides a series of embeddable ArcGIS components that are used outside the 4 • ArcGIS Desktop Developer Guide Ch01-Intro.pmd 4 1/27/2005, 1:42 PM ARCGIS 9 DEVELOPER OVERVIEW ArcGIS Desktop application framework (for example, mapping objects are managed as part of ArcGIS Engine, rather than in ArcMap). Using the ArcGIS Engine Developer Kit, developers build focused GIS solutions with simple interfaces to access any set of GIS functions or can embed GIS logic in existing user applications to deploy GIS to broad groups of users. ArcGIS Engine has a COM, .NET, Java, and C++ application programming interface (API) for devel- opers. The ArcGIS Server Developer Kit ArcGIS Server defines and implements a set of standard GIS Web services (for example, mapping, data access, and geocoding), as well as supports enterprise- level application development based on ArcObjects for the server. The ArcGIS Server Developer Kit enables developers to build central GIS servers to host GIS functions that are accessed by many users, perform back office pro- cessing on large central GIS databases, build and deliver GIS Web applications, and perform distributed GIS computing. Chapter 1 (cid:127) Introducing ArcGIS Desktop development (cid:127) 5 Ch01-Intro.pmd 5 1/26/2005, 7:03 AM ARCGIS DESKTOP DEVELOPER OVERVIEW ArcGIS Desktop includes a suite of integrated applications, including ArcMap, ArcCatalog, and ArcToolbox. By using these applications and interfaces in unison, you can perform any GIS task, simple to advanced, including mapping, geographic analysis, data editing and compilation, data management, visualization, and geoprocessing. WHAT ARE ARCVIEW, ARCEDITOR, AND ARCINFO? ArcGIS Desktop is the information authoring and usage tool for GIS profession- als. It is scalable as three separate software products to meet the needs of many types of users. ArcView provides comprehensive mapping and analysis tools along with simple editing and geoprocessing. ArcEditor includes advanced editing capabilities for shapefiles and geodatabases in addition to the full functionality of ArcView. ArcInfo is the flagship ArcGIS Desktop product. It builds on the functionality of ArcEditor with advanced geoprocessing. It also includes the legacy applica- tions for ArcInfo Workstation. Because ArcView, ArcEditor, and ArcInfo all share a common architecture, users working with any of these GIS desktops can share their work with other users. Maps, data, symbology, map layers, custom tools and interfaces, reports, metadata, and so on, can be accessed interchangeably in all three products. This means that you benefit from using a single architecture, minimizing the need to learn and deploy several different architectures. New capabilities can be added to all seats through a series of ArcGIS Desktop extensions from ESRI and other organizations. Users can also develop their own custom extensions to ArcGIS Desktop by working with ArcObjects, the ArcGIS software component library. Users develop extensions and custom tools using standard Windows programming interfaces, such as COM and .NET. ArcObjects is a framework that lets you create domain-specific components from other components. The ArcObjects components collaborate to serve every data management and map presentation function common to most GIS applications. ArcObjects provides an infrastructure for application customization that lets you concentrate on serving the specific needs of your clients. ArcMap ArcMap is the central application in ArcGIS Desktop. It is the GIS application used for all map-based tasks, including cartography, map analysis, and editing. In this application, you work with maps. Maps have a page layout containing a geographic window, or a data frame, with a series of layers, legends, scalebars, North arrows, and other elements. ArcMap offers different ways to view a map’s geographic data and layout views in which you can perform a broad range of advanced GIS tasks. ArcMap is used for mapping and editing tasks as well as map-based analysis. 6 (cid:127) ArcGIS Desktop Developer Guide Ch01-Intro.pmd 6 1/26/2005, 7:03 AM

Description:
2 • ArcGIS Desktop Developer Guide ArcGIS 9 is an integrated family of geographic information system (GIS) soft-ware products for building a complete GIS.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.