Delivering Custom Gis Applications With Arcgis Engine: An Esri White Paper - February 2004
Delivering Custom Gis Applications With Arcgis Engine: An Esri White Paper - February 2004
ESRI 380 New York St., Redlands, CA 92373-8100, USA TEL 909-793-2853 FAX 909-793-5953 E-MAIL [email protected] WEB www.esri.com
Copyright 2004 ESRI All rights reserved. Printed in the United States of America. The information contained in this document is the exclusive property of ESRI. This work is protected under United States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing by ESRI. All requests should be sent to Attention: Contracts Manager, ESRI, 380 New York Street, Redlands, CA 92373-8100, USA. The information contained in this document is subject to change without notice. U.S. GOVERNMENT RESTRICTED/LIMITED RIGHTS Any software, documentation, and/or data delivered hereunder is subject to the terms of the License Agreement. In no event shall the U.S. Government acquire greater than RESTRICTED/LIMITED RIGHTS. At a minimum, use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in FAR 52.227-14 Alternates I, II, and III (JUN 1987); FAR 52.227-19 (JUN 1987) and/or FAR 12.211/12.212 (Commercial Technical Data/Computer Software); and DFARS 252.227-7015 (NOV 1995) (Technical Data) and/or DFARS 227.7202 (Computer Software), as applicable. Contractor/Manufacturer is ESRI, 380 New York Street, Redlands, CA 92373-8100, USA. ESRI, the ESRI globe logo, ArcGIS, ArcIMS, ArcSDE, ArcObjects, ArcReader, ArcView, ArcEditor, ArcInfo, 3D Analyst, StreetMap, ArcMap, ArcScene, ArcGlobe, ArcCatalog, www.esri.com, and @esri.com are trademarks, registered trademarks, or service marks of ESRI in the United States, the European Community, or certain other jurisdictions. Other companies and products mentioned herein are trademarks or registered trademarks of their respective trademark owners.
J-9202
Introduction........................................................................................... Why the Interest in Delivering Custom GIS Applications?............ Solutions for Efficient GIS Development....................................... ArcGIS Developer Overview.......................................................... Introduction to ArcGIS Engine............................................................. Why Use ArcGIS Engine? .............................................................. What Developers Can Do With ArcGIS Engine............................. Key Features of ArcGIS Engine ..................................................... ArcGIS Engine Developer Kit ........................................................ Developing With ArcGIS Engine ......................................................... Framework/Architecture ................................................................. ArcGIS Engine Object Libraries..................................................... System....................................................................................... SystemUI................................................................................... Geometry................................................................................... Display ...................................................................................... Server ........................................................................................ Output ....................................................................................... Geodatabase .............................................................................. GISClient .................................................................................. DataSourcesFile ........................................................................ DataSourcesGDB...................................................................... GeoDatabaseDistributed ........................................................... DataSourcesOleDB ................................................................... DataSourcesRaster .................................................................... Carto..........................................................................................
Contents
Page 10 10 10 10 10 10 10 10 10 11 11 11 12 16 17 17 18 18 18 18 18 19 19 19
Location .................................................................................... NetworkAnalysis....................................................................... Controls..................................................................................... GeoAnalyst ............................................................................... 3DAnalyst ................................................................................. GlobeCore ................................................................................. SpatialAnalyst ........................................................................... ArcGIS Engine Tool Set ................................................................. Feature Selection for Use With Map Control or Page Layout ............................................................................ Graphic Elements for Use With Map Control or Page Layout ............................................................................ Map Navigation for Use With Map Control or Page Layout ............................................................................ Page Layout for Use With Page Layout ................................... Building Applications With ArcGIS Engine .................................. ArcGIS Engine Runtime ................................................................. Deploying and Licensing ArcGIS Engine Applications....................... Deploying ArcGIS Engine Runtime ............................................... Deployment Methods................................................................ Licensing ArcGIS Engine Runtime ................................................ ArcGIS Developer Resources ............................................................... ArcGIS Developer Help System..................................................... The ArcGIS Developer Book Series............................................... ArcGIS Developer Online............................................................... ESRI Support Center....................................................................... Training...........................................................................................
Conclusion ............................................................................................ 19
February 2004
ii
J-9202
ArcGIS is an integrated family of GIS software products for delivering a complete, scalable GIS at the individual project, work group, and enterprise levels. It is based on a common library of shared GIS software components called ArcObjects. ArcGIS consists of the following key parts:
ArcGIS Desktop: an integrated suite of advanced GIS products (ArcReader, ArcView, ArcEditor, ArcInfo, ArcGIS extensions). ArcGIS Engine: embeddable GIS component libraries for building custom, industry-focused applications using C++, COM, .NET, and Java. ArcGIS Server: shared library of GIS software objects used to build serverside GIS applications in enterprise and Web computing frameworks. It is used for building both SOAP-based Web services and Web applications using .NET/ASP and Java/JSP. ArcIMS: GIS Web services to publish maps, data, and metadata through open Internet protocols. ArcSDE: an interface for managing geodatabases in numerous database management systems (DBMSs). The ArcGIS system is built and extended using ArcObjects software components. ArcObjects is composed of platform-neutral C++ software objects that can run on both Windows and UNIX platforms and have multiple developer application programming interfaces (APIs). These include COM, .NET, Java, and C++. Developers can use these APIs to build applications that make use of ArcObjects functionality. ArcObjects is at the core of all the ArcGIS productsArcGIS Desktop, ArcGIS Engine, and ArcGIS Serverproviding a common developer experience across all ArcGIS products. There is a wide range of possibilities available when developing with ArcGIS. Developers can Configure/Customize ArcGIS Desktop products. Extend the ArcGIS architecture and data model. Embed maps and GIS functionality in other applications with ArcGIS Engine. Build and deploy custom desktop applications with ArcGIS Engine. Build Web services and applications with ArcGIS Server.
February 2004
ArcGIS Engine provides new and improved tools for developers as well as new deployment options and resources. ArcGIS Engine is a set of the core ArcObjects components packaged together for developers to build custom GIS and mapping applications. These objects are platform neutral and can be called from various APIs. Developers can extend the object libraries and have complete control over the look and feel of their applications' user interfaces.
ArcGIS Engine is a complete library of embeddable GIS components and tools packaged together for developers to build new or extend existing custom desktop applications. Using ArcGIS Engine, developers can embed GIS functions into existing applications, such as custom industry specific products, and commercial productivity applications, such as Microsoft Word and Excel, as well as build focused custom applications for delivering GIS to many users in their organizations.
Applications built with ArcGIS Engine are licensed and distributed to end users.
ArcGIS Engine consists of two products: a software development kit to build and a redistributable runtime to enable execution of the completed applications. The ArcGIS Engine Developer Kit is a component-based software development product for building custom GIS and mapping applications. The ArcGIS Engine Developer Kit is not an end user product but rather a toolkit for application developers, suitable for building basic mapping and comprehensive, dynamic GIS applications for Windows, UNIX, or Linux users. The ArcGIS Engine Runtime is the product that contains the core ArcObjects components to enable the execution of the end user application and will be installed on each computer that is running an ArcGIS Engine application.
Many users require focused, industry specific access to GIS from within familiar software applications. They need much less than the general GIS products, yet they may require access to sophisticated GIS logic in their applications. In cases in which users need customized access to GIS, ArcGIS Engine provides an alternative to general software applications. ArcGIS Engine is used to Embed GIS logic in custom applications. Efficiently build and deploy GIS applications. Provide access to advanced GIS logic from simple applications. Embed GIS logic and maps in other applications. Build cross platform applications with C++ or Java.
February 2004
As a developer, you can implement these and many other functions in programs built with the ArcGIS Engine Developer Kit. Display a map with multiple map layers such as roads, streams, and boundaries. Pan and zoom throughout a map. Identify features on a map by clicking them. Search for features on a map. Display labels with text from field values. Draw images from aerial photography or satellite imagery. Draw graphic features such as points, lines, circles, and polygons. Draw descriptive text. Select features along lines and inside boxes, areas, polygons, and circles. Select features within a specified distance of other features. Find and select features with a Structured Query Language (SQL) expression. Render features with thematic methods such as value map, class breaks, and dot density. Dynamically display real-time or time series data. Find locations on a map from a street address or intersection you provide. Transform the coordinate system of your map data. Perform geometric operations on shapes to create buffers; calculate differences; or find intersections, unions, or inverse intersections of shapes. Manipulate the shape or rotation of a map. Create and update geographic features and their attributes. Interact with personal and enterprise geodatabases. ArcGIS Engine is suitable for building basic mapping to advanced GIS applications.
Standard GIS framework: ArcGIS Engine provides a standard framework for developing GIS applications. The world's most popular GIS software products (ArcView, ArcEditor, and ArcInfo) are built from this same set of software objects. ArcGIS Engine is both robust and extensible, and its rich functionality allows developers to concentrate on solving organizational problems, not building GIS functionality from scratch. Cost-effective deployment: ArcGIS Engine Runtime is licensed per computer. This allows multiple ArcGIS applications to run on the same computer, incurring the cost of only a single runtime license. Developer controls: ArcGIS Engine provides a common set of developer controls that allow developers to easily deploy well-crafted applications with a common look and feel. A common user experience leads to a short learning curve for users, so returns on the applications are quickly realized. Cross platform functionality: ArcGIS Engine and all of its associated objects and controls are available on a wide variety of platforms including Windows, Linux, and UNIX. Custom GIS applications will fit within standard computing environments; there is no need to change or add operating environments to the present computing infrastructure. Cross developer languages: ArcGIS Engine supports a variety of developer languages for its use including COM, .NET, Java, and C++. This allows the objects to be programmed using a wide range of tools and should not require the programming staff to learn a new or proprietary language.
February 2004
ArcGIS extension functionality: The ArcGIS Engine Developer Kit includes the extended functionality to update and create a multiuser geodatabase as well as the functionality of ArcGIS 3D Analyst, ArcGIS Spatial Analyst, and ArcGIS StreetMap USA products. Developer resources: The ArcGIS Engine Developer Kit provides a help system, along with object model diagrams and sample code, to help developers get started. Several developer tools and utilities are also included in ArcGIS Engine Developer Kit to facilitate development with ArcGIS Engine.
The ArcGIS Engine Developer Kit software is a set of mapping components that enables programmers to add dynamic mapping and GIS capabilities to existing applications or build custom mapping and GIS solutions. With the ArcGIS Engine Developer Kit, programmers have unprecedented flexibility for creating customized interfaces for maps and spatial analysis. One can use several industry-standard programming environments to create unique applications or combine the ArcGIS Engine components with other software components to take advantage of the synergistic relationship between maps and the information that users collect and manage.
The ArcGIS Engine Developer Kit includes all the developer resources to support comprehensive development tasks. An integrated help system is provided for several APIs (COM, Java, .NET, and C++) along with object model diagrams and samples for each part of ArcGIS Engine. The ArcGIS Engine Developer Kit is not an end user product. It is strictly for people who are developing applications. Developers will build applications based on ArcGIS Engine and deliver those programs to end users. An important feature of ArcGIS Engine is that the map displays can be either an incidental or central element in the application. This feature makes ArcGIS Engine particularly well-suited to vertical market applications. If, for example, the focus of the application is a database with information about available business property for lease, using ArcGIS Engine, the program can display a form with a map highlighting the business location of interest when the end user performs a query on that database. Going a step further, the application could display images of the building, floor plans, parking structures, and demographic information about the surrounding neighborhood.
The ArcGIS Engine Developer Kit provides access to a large collection of ArcObjects components but also includes several visual developer controls for creating a high-quality mapping user interface. ArcGIS Engine includes the following visual components to assist with application development: Map Control Page Layout Control Toolbar Control Reader Control Globe Control Scene Control Table of Contents Control Collection of commands and tools for use with the Toolbar Control
Map Control
Globe Control
Scene Control
These visual components are available as ActiveX controls, JavaBeans, .NET Windows controls, and Motif widgets. The ArcGIS Engine Developer Kit controls can
February 2004
be combined with other controls and components to create customized user interfaces, displays, and reports.
DataSourcesGDB
The DataSourcesGDB library contains the workspace factories and workspaces for vector and raster data formats supported by the geodatabase, which are stored within an RDBMS. The GeoDatabaseDistributed library contains the objects required to perform checkout from/check-in to operations supporting distributed geodatabase. The DataSourcesOleDB library provides workspaces for working with object linking and embedding database (OLE_DB)-based data sources. The DataSourcesRaster library contains the workspace factories and workspaces for file-based raster data formats. The Carto library contains the objects for displaying data. The Location library contains objects related to working with location data. Location data can typically either be route events or geocoding locations. The NetworkAnalysis library supports the creation and analysis of utility networks. The Controls library contains controls for application development including commands and tools for use with the controls. The GeoAnalyst library contains core spatial analysis operations that are used by both the Spatial Analyst and 3D Analyst extensions. The 3DAnalyst library contains objects for performing 3D analysis of data, along with the support for displaying 3D data. A control is available in this library for developers to use. A 3D Analyst extension license is required to work with objects in this library. The GlobeCore library contains objects for performing analysis of globe data along with the support for displaying globe data. A control is available in this library for developers to use. A 3D Analyst extension license is required to work with objects in this library. The SpatialAnalyst library contains objects for performing spatial analysis on raster and vector data. An ArcGIS Spatial Analyst license is required to work with objects in this library. The ArcGIS Engine Developer Kit provides several prebuilt tools and commands that can be used in conjunction with the Toolbar Control to rapidly add basic mapping functionality to an application. Here are some of the frequently used elements.
GeoDatabase Distributed DataSourcesOleDB DataSourcesRaster Carto Location NetworkAnalysis Controls GeoAnalyst 3DAnalyst
GlobeCore
SpatialAnalyst
ArcGIS Engine Tool Set Feature Selection for Use With Map Control or Page Layout
February 2004
10
11
Developers build ArcGIS Engine applications in their chosen integrated development environment (IDE) such as Microsoft VisualStudio and Delphi for Windows developers Eclipse, Sun ONE Studio, and Borland JBuilder for Java developers Developers register the ArcGIS Engine Developer Kit components with their IDE, then create form-based applications, adding ArcGIS Engine components and writing code to build their applications.
For example, a Java developer can build a focused GIS mapping application by adding a Map Control, a Table of Contents Control, and selected toolbars to his/her application. The developer can associate an ESRI ArcMap map definition file (.MXD), ArcScene file (.SXD), or ArcGlobe file (.3DD) with the control and can program additional buttons and other functions for focused tasks. The finished application can then be installed on any ArcGIS Engine Runtime seat (including ArcGIS Desktop seats) to deploy the application.
February 2004
12
In addition to the above application that displays mapping data in a "globe" context, here are several other examples of the types of applications that benefit from ArcGIS Engine technology.
13
A city government department may want to build a series of focused parcel review applications that access information from the GIS database, integrating it with other critical enterprise work orders for permitting, taxation, planning review, and so forth.
February 2004
14
ArcGIS Engine components can be embedded in Microsoft Word documents to help make connections between text and tabular information with spatial data.
Trouble Ticket Report in Microsoft Word With Embedded ArcGIS Engine Map
15
All applications built with the ArcGIS Engine Developer Kit will need ArcGIS Engine Runtime or an ArcGIS Desktop product (ArcView, ArcEditor, or ArcInfo) with the appropriate level of license to execute successfully.
The standard ArcGIS Engine Runtime provides the core functionality of all ArcGIS products. The standard ArcGIS Engine Runtime can be enhanced with full readwrite access to a multiuser geodatabase along with advanced functionality for 3D visualization, spatial analysis, and detailed U.S. street data.
February 2004
16
The Geodatabase Update option to ArcGIS Engine Runtime provides developers with the necessary ArcObjects components to build solutions that deal with data automation and compilation and the construction and maintenance of complex geodatabase features. This includes the ability to work with schemas and versioned multiuser geodatabases. The ArcGIS Engine Geodatabase option provides the capability to programmatically create personal or enterprise geodatabases with geometric networks, relationship classes, subtypes, feature-linked annotation, dimension classes, and custom behavior. ArcGIS Engine developers with access to a DBMS via ArcSDE will be able to build and deploy solutions that deal with the editing and maintenance of multiuser geodatabases. This includes access to the ArcObjects components necessary for version management of the geodatabase. The Spatial option to ArcGIS Engine Runtime provides a powerful set of functions that allows users to create, query, and analyze cell-based raster data. Using the Spatial option to ArcGIS Engine Runtime, users can derive information about data, identify spatial relationships, find suitable locations, and calculate the accumulated cost of traveling from one point to another. ArcGIS Engine Runtime 3D option enables the creation of applications that effectively visualize data in 3D and globally. This option supplements ArcGIS Engine with components for examining a surface from multiple viewpoints and determining what is visible from a chosen location. ArcGIS Engine Runtime can also be extended with the StreetMap USA option. The StreetMap USA option provides U.S. street-level mapping and address matching. StreetMap layers automatically manage, label, and draw features such as local landmarks, streets, parks, and water bodies. All data comes compressed on CDROM. The end user or the developer of the ArcGIS Engine application can configure a software license file that controls the availability of the options' functionality.
Deploying and Licensing ArcGIS Engine Applications Deploying ArcGIS Engine Runtime
An ArcGIS Engine application requires ArcGIS Engine Runtime software to be installed on the end user's machine. To ensure that ArcGIS Engine Runtime is on the machine, a developer can have the user run the ArcGIS Engine Runtime setup directly and install the license key or include the ArcGIS Engine Runtime setup in the application's setup program. The ArcGIS Engine Runtime setup can be accomplished in an application's installation using a number of methods that are detailed in the ArcGIS Engine Developer Guide.
17
Deployment Methods
There are two recommended methods for deploying ArcGIS Engine Runtime. Install the ArcGIS Engine Runtime setup directly from the CD. The ArcGIS Engine Runtime setup can be redistributed on the application's CD. Developers may copy the contents of ArcGIS Engine Runtime CD images and create additional CDs or contact ESRI to obtain additional ArcGIS Engine Runtime CDs. Incorporate the ArcGIS Engine Runtime setup to run within the application's setup program. ArcGIS Engine can be installed without a user interface by running the setup using Windows Installer command line parameters. This method streamlines installation of the final end user product.
Each stand-alone application developed using ArcGIS Engine must initialize itself with a suitable license to ensure it runs successfully on any machine on which it is installed. License initialization is performed by an application at application startup, before any ArcObjects components are accessed. If license initialization is performed after ArcObjects components are accessed, application errors will result. License files are provided by ESRI Customer Service to the party who purchases ArcGIS Engine Runtimeeither the developer who is producing the application or the end user who has received an application from a developer who expects the end user to be responsible for purchasing the runtime from ESRI and enabling the license file. The ArcGIS Engine Developer Guide provides detailed instructions for the developer that includes the license file with a packaged application and for the end user who needs to install the license file independent of the developer.
The following topics describe some additional resources available to ArcGIS developers. These include books, guides, and various help systems available to ensure success with all aspects of building and deploying ArcGIS Engine applications. The ArcGIS Developer Help system is an essential resource for both beginning and experienced ArcGIS Engine developers. It contains information on developing with ArcObjects including sample code, technical documents, and object model diagrams. In addition, it serves as a reference guide, containing information on every object within ArcObjects. ArcGIS Developer Help is designed for Visual Basic, .NET, Java, and C++ developers and is placed on the hard drive during the ArcGIS Engine Developer Kit installation. Each part of the ArcGIS systemDesktop, Engine, and Serverhas a developer guide to help developers get started with ArcObjects and the different supported APIs. The ArcGIS Engine Developer Guide provides information for developers who wish to create and deploy custom applications based on ArcGIS Engine and the different developer controls and components. The ArcGIS Desktop Developer Guide is for developers who want to customize or extend one of the ArcGIS Desktop applications such as ArcMap or ArcCatalog. Developers can use Visual Basic for Applications (VBA) to customize and Visual Basic, Visual C++, or .NET to extend the applications. The ArcGIS Server Developer Guide is for developers who want to use ArcGIS Server to build custom server applications. Server developers can build Web services and Web applications that do simple mapping or include advanced GIS functionality. Each book
February 2004
18
provides several scenarios that illustrate with code examples some of the different types of applications that can be developed using one of the ArcGIS Developer Kits.
ArcGIS Developer Online is the Web-based equivalent of the ArcGIS Developer Help system and contains the same information. The site can be found at http://arcgisdeveloperonline.esri.com. The online site has several advantages, including being accessible via a Web browser on computers without ArcGIS installed, and is updated frequently with new material such as samples, technical documents, and corrections. Use the online site to get the most up-todate information available for ArcGIS developers.
The ESRI Support Center, at http://support.esri.com, contains software information, technical documents, samples, user forums, and a knowledge base for all ArcGIS products. ArcGIS developers can take advantage of the forums, knowledge base, and samples sections in particular to aid in the development of their ArcGIS applications. ESRI offers a number of instructor-led and Web-based training courses for ArcGIS developers. These courses range from the introductory level for VBA to the more advanced courses in component development for ArcGIS Desktop, ArcGIS Engine, and ArcGIS Server with specific APIs. For more information, visit www.esri.com/training. ArcGIS Engine is a new addition to the ArcGIS family of products. ESRI customers and prospects have expressed a strong interest in the ability to develop desktop applications on the ArcGIS ArcObjects framework with the capability to build custom, industry specific user interfaces. The right platform on which to effectively host a GIS development effort is a cross platform, standards-based component framework that will allow solution providers or an organization's internal developers to rapidly build industry specific applications. A GIS development framework provides the necessary comprehensive spatial functionality for applications and allows the software developer to focus efforts on building application specific logic. ArcGIS Engine is that GIS framework, created in response to requests that ArcObjects and supporting developer resources be packaged for fast, comprehensive, and cost-effective delivery of GIS and mapping applications that reach beyond the traditional GIS user. For more information about ArcGIS Engine, please visit www.esri.com/arcgisengine.
Training
Conclusion
19