Working with the ArcGIS Server ArcObjects API  

Overview

 


This section will focus on working with ArcObjects in .NET using ArcGIS Server.  The Web ADF and Mobile ADF provide additional developer components to enhance working within a specific application environment.  In both products, the ArcGIS Server ArcObjects API is available for use when accessing ArcGIS Server data sources.  See the sections titled Developing Web Applications using the Web ADF and Developing Mobile Applications using the Mobile ADF for more information.  
 

In simple terms, ArcObjects are a set of COM components.  To work with ArcObjects in the .NET development environment, a collection of .NET primary interop assemblies and COM object libraries have been generated to manage .NET-COM interaction.   ArcObjects components are installed with the ArcGIS Desktop, ArcGIS Engine, or ArcGIS Server products.   They can be accessed locally on any machine where they've been installed.  To access ArcObjects remotely using ArcGIS Server (via distributed COM or DCOM), only the .NET primary interop assemblies and COM object libraries must be installed on the client machine.  The COM object libraries act as proxies to ArcObjects components on a remote server.   The ArcGIS Server API provides the environment for a developer to work with and manage ArcObjects remotely, via ArcGIS Server.  Both the Web ADF and Mobile ADF for the Microsoft .NET Framework include the .NET primary interop assemblies and ArcObjects proxies.  A more detailed discussion is included below.


 

 

It is possible to write a number of different types of applications using ArcGIS Server. The developer who works with the ArcGIS Server ArcObjects API using the Microsoft .NET Framework can build server applications, such as Web applications, Web services, desktop client application, and mobile applications. 

ArcGIS Engine developers can build desktop applications that work with ArcObjects both locally and remotely via ArcGIS Server. ArcGIS Desktop developers can extend the ArcGIS Desktop applications to include functionality that makes use of the GIS server. In both of these cases, the deployment of the application itself requires an ArcGIS Engine runtime deployment license or an ArcGIS Desktop license.

In the case of ArcGIS Desktop and ArcGIS Engine, developers who write desktop applications that use the server will have ArcObjects installed locally, on the machine where the application is both developed and deployed. When using these products to write applications that use ArcGIS Server, you must follow the same programming guidelines as a developer using the ArcGIS Server API to build a server application, such as a Web application that is deployed within a Web server. The only difference is that in the case of the desktop application, each instance of your application is bound to a single user session (though there might be multiple instances of your application running at any time), while Web applications or Web services are multiuser/multi-session applications.

The Web ADF for the Microsoft .NET Framework does not include ArcObjects components. Instead, the ADF includes .NET primary interop assemblies and ArcObjects COM object libraries, also known as proxy objects. Applications that are built and deployed using Web ADF must follow the coding guidelines of the server, or they won't work. Those aspects of the coding guidelines will become more apparent in subsequent topics.

A proxy object is a local representation of a remote object. The proxy object controls access to the remote object by forcing all interaction with the remote object to be via the proxy object. The supported interfaces and methods on a proxy object are the same as those supported by the remote object. You can make method calls on, and get and set properties of, a proxy object as if you were working directly with the remote object.


The ArcGIS Server ArcObjects API

Programming with the ArcGIS Server ArcObjects API is all about remotely programming ArcObjects. Programming ArcObjects remotely is the same as programming ArcObjects for use in desktop applications, but there are some additional details and programming guidelines you need to follow. You need to understand:

The rest of programming the server is just programming ArcObjects. Each aspect of programming the server listed above will be described in more detail in the following sections.

ArcGIS Server developers have access to both the Web ADF and the ArcGIS Server API.  While the Web ADF provides a set Web controls and convenience classes to work with multiple data sources, it may be necessary to work with functionality specifically available in ArcObjects via ArcGIS Server.  The Web ADF provides a means to access ArcGIS Server specifically, see the Web ADF section titled Access a data source specific API.  Of course, you can build almost any application type and choose to work only with ArcGIS Server via the ArcObjects API.  Building practical applications requires knowledge of the object libraries that compose the ArcGIS Server. The libraries contained within the ArcGIS Server are summarized below. The diagrams that accompany this section indicate the library architecture of the ArcGIS Server. Understanding the library structure, their dependencies, and basic functionality will help you as a developer navigate through the components of ArcGIS Server.  The libraries are discussed in dependency order, which is shown in the diagram below using a number in the upper right corner of the library block.


For a comprehensive discussion on each library, refer to the library overview topics, a part of the library reference section of the ArcGIS Developer Help system.


Object libraries are logical collections of the programmable ArcObjects components, ranging from fine-grained objects (for example, individual geometry objects) to coarse-grained objects, which aggregate logical collections of functionality (for example, an ArcMap object to work with map documents).  Programmers can use a number of standards-based APIs (COM, .NET, Java, and C++) to work with ArcObjects on the server.  These same libraries are also used to program with ArcGIS Desktop and ArcGIS Engine.

System

The System library is the lowest level library in the ArcGIS architecture. The library contains components that expose services used by the other libraries composing ArcGIS. There are a number of interfaces defined within System that can be implemented by the developer. The developer does not extend this library but can extend the ArcGIS system by implementing interfaces contained within this library.

SystemUI

The SystemUI library contains the interface definitions for user interface components that can be extended within the ArcGIS system. These include the ICommand, ITool, and IToolControl interfaces. The objects contained within this library are utility objects available to the developer to simplify some user interface developments. The developer does not extend this library but can extend the ArcGIS system by implementing interfaces contained within this library.

Geometry

The Geometry library handles the geometry, or shape, of features stored in feature classes or other graphical elements. The fundamental geometry objects that most users will interact with are Point, MultiPoint, Polyline, and Polygon. Besides those top-level entities are geometries that serve as building blocks for polylines and polygons. Those are the primitives that compose the geometries. They are Segments, Paths, and Rings. Polylines and polygons are composed of a sequence of connected segments that form a path. A segment consists of two distinguished points, the start and the end point, and an element type that defines the curve from start to end. The types of segments are CircularArc, Line, EllipticArc, and BezierCurve. All geometry objects can have Z, M, and IDs associated with their vertices. The fundamental geometry objects all support geometric operations such as Buffer and Clip . The geometry primitives are not meant to be extended by developers.

Entities within a GIS refer to real-world features; the location of these real-world features is defined by a geometry along with a spatial reference. Spatial reference objects, for both projected and geographic coordinate systems, are included in the Geometry library. Developers can extend the spatial reference system by adding new spatial references and projections between spatial references.

Display

The Display library contains objects used for the display of GIS data. In addition to the main display objects responsible for the actual output of the image, the library contains objects that represent symbols and colors used to control the properties of entities drawn on the display. The library also contains objects that provide the user with visual feedback when interacting with the display. Developers most often interact with Display through a view similar to the ones provided by the Map or PageLayout objects. All parts of the library can be extended; commonly extended areas are symbols, colors, and display feedbacks.

Server

The Server library contains objects that allow you to connect and work with ArcGIS Servers. Developers gain access to an ArcGIS Server using the GISServerConnection object. The GISServerConnection object gives access to the ServerObjectManager. Using this object, a developer works with ServerContext objects to manipulate ArcObjects running on the server. The Server library is not extended by developers. Developers can also use the GISClient library when interacting with the ArcGIS Server.

Output

The Output library is used to create graphical output to devices, such as printers and plotters, and hardcopy formats such as enhanced metafiles and raster image formats (JPG, BMP, and so on). The developer uses the objects in the library with other parts of the ArcGIS system to create graphical output. Usually these would be objects in the Display and Carto libraries. Developers can extend the Output library for custom devices and export formats.

GeoDatabase

The GeoDatabase library provides the programming API for the geodatabase. The geodatabase is a repository of geographic data built on standard industry and object relational database technology. The objects within the library provide a unified programming model for all supported data sources within ArcGIS. The GeoDatabase library defines many of the interfaces that are implemented by data source providers higher in the architecture. The geodatabase can be extended by developers to support specialized types of data objects (features, classes, and so forth); in addition, it can have custom vector data sources added using the PlugInDataSource objects. The native data types supported by the geodatabase cannot be extended.

GISClient

The GISClient library allows developers to consume Web services; these Web services can be provided by ArcIMS and ArcGIS Server. The library includes objects for connecting to GIS servers to make use of Web services. There is support for ArcIMS Image and Feature Services. The library provides a common programming model for working with ArcGIS Server objects in a stateless manner either directly or through a Web service catalog. The ArcObjects components running on the ArcGIS Server are not accessible through the GISClient interface. To gain direct access to ArcObjects components running on the server, you should use functionality in the Server library.

DataSourcesFile

The DataSourcesFile library contains the implementation of the GeoDatabase API for file-based data sources. These file-based data sources include shapefile, coverage, triangulated irregular network (TIN), computer-aided drafting (CAD), smart data compression (SDC), and vector product format (VPF). The DataSourcesFile library is not extended by developers.

DataSourcesGDB

The DataSourcesGDB library contains the implementation of the GeoDatabase API for the database data sources. These data sources include Microsoft Access and relational database management systems supported by ArcSDE—IBM DB2, Informix, Microsoft SQL Server, and Oracle. The DataSourcesGDB library is not extended by developers.

DataSourcesOleDB

The DataSourcesOleDB library contains the implementation of the GeoDatabase API for the Microsoft OLE DB data sources. This library is only available on the Microsoft Windows operating system. These data sources include any OLE DB-supported data provider and text file workspaces. The DataSourcesOleDB library is not extended by developers.

DataSourcesRaster

The DataSourcesRaster library contains the implementation of the GeoDatabase API for the raster data sources. These data sources include relational database management systems supported by ArcSDE—IBM DB2, Informix, Microsoft SQL Server, and Oracle—along with supported Raster Data Objects (RDO) raster file formats. Developers do not extend this library when support for new raster formats is required; rather, they extend RDO. The DataSourcesRaster library is not extended by developers.

A Raster Data Object is a COM API that provides display and analysis support for file- based raster data.

GeoDatabaseDistributed

The GeoDatabaseDistributed library supports distributed access to an enterprise geodatabase by providing tools for importing data into and exporting data out of a geodatabase. The GeoDatabaseDistributed library is not extended by developers.

Carto

The Carto library supports the creation and display of maps; these maps can consist of data in one map or a page with many maps and associated marginalia. The PageLayout object is a container for hosting one or more maps and their associated marginalia: North arrows, legends, scale bars, and so on. The Map object is a container of layers. The Map object has properties that operate on all layers within the map—spatial reference, map scale, and so on—along with methods that manipulate the map's layers. There are many different types of layers that can be added to a map. Different data sources often have an associated layer responsible for displaying the data on the map: vector features are handled by the FeatureLayer object, raster data by the RasterLayer, TIN data by the TinLayer, and so on. Layers can, if required, handle all the drawing operations for their associated data, but it is more common for layers to have an associated Renderer object. The properties of the Renderer object control how the data is displayed in the map. Renderers commonly use symbols from the Display library for the actual drawing; the renderer simply matches a particular symbol with the properties of the entity that is to be drawn. A Map object, along with a PageLayout object, can contain elements. An element has geometry to define its location on the map or page, along with behavior that controls the display of the element. There are elements for basic shapes, text labels, complex marginalia, and so on. The Carto library also contains support for map annotation and dynamic labeling.

Although developers can directly make use of the Map or PageLayout objects in their applications, it is more common for developers to use a higher level object such as the MapControl, PageLayoutControl, or an ArcGIS application. These higher level objects simplify some tasks, although they always provide access to the lower level Map and PageLayout objects, allowing the developer fine control of the objects.

The ArcGIS Server uses the MapServer object to work with a Map.

The Map and PageLayout objects are not the only objects in Carto that expose the behavior of map and page drawing. The MxdServer and MapServer objects both support the rendering of maps and pages, but instead of rendering to a window, these objects render directly to a file.

Using the MapDocument object, developers can persist the state of the map and page layout within a map document (.mxd), which can be used in ArcMap or one of the ArcGIS controls.

The Carto library is commonly extended in a number of areas. Custom renderers, layers, and so forth, are common. A custom layer is often the easiest method of adding custom data support to a mapping application.

Location

The Location library contains objects that support geocoding and working with route events. The geocoding functionality can be accessed through fine-grained objects for full control, or the GeocodeServer objects offers a simplified API. Developers can create their own geocoding objects. The linear referencing functionality provides objects for adding events to linear features and rendering these events using a variety of drawing options. The developer can extend the linear reference functionality.

NetworkAnalyst

The NetworkAnalyst library contains objects for working with network datasets. Developers can extend this library by creating new network servers. A license for the Network Analyst extension of the ArcGIS Engine Runtime Network option is required to make use of the objects in this library.

NetworkAnalysis

The NetworkAnalysis library provides objects for populating a geodatabase with network data and objects to analyze the network when it is loaded in the geodatabase. Developers can extend this library to support custom network tracing. The library is meant to work with utility networks: gas lines, electricity supply lines, and so on.



GeoAnalyst

The GeoAnalyst library contains objects that support core spatial analysis functions. These functions are used within both the SpatialAnalyst and 3DAnalyst libraries. Developers can extend the library by creating a new type of raster operation. A license for either the ArcGIS Spatial Analyst or 3D Analyst extension or the ArcGIS Engine Runtime Spatial or 3D extension is required to make use of the objects in this library.

3DAnalyst

The 3DAnalyst library contains objects for working with 3D scenes in a similar way that the Carto library contains objects for working with 2D maps. The Scene object is one of the main objects of the library since it is the container for data similar to the Map object. The Camera and Target objects specify how the scene is viewed regarding the positioning of the features relative to the observer. A scene consists of one or more layers; these layers specify the data in the scene and how the data is drawn.

It is not common for developers to extend this library. A license for either the ArcGIS 3D Analyst extension or the ArcGIS Engine Runtime 3D extension is required to work with objects in this library.

GlobeCore

The GlobeCore library contains objects for working with globe data in a similar way that the Carto library contains objects for working with 2D maps. The Globe object is one of the main objects of the library since it is the container for data similar to the Map object. The GlobeCamera object specifies how the globe is viewed regarding the positioning of the globe relative to the observer. The globe can have one or more layers; these layers specify the data on the globe and how the data is drawn.

It is not common for developers to extend this library. A license for either the ArcGIS 3D Analyst extension or the ArcGIS Engine Runtime 3D extension is required to work with objects in this library.

SpatialAnalyst

The SpatialAnalyst library contains objects for performing spatial analysis on raster and vector data. Developers most commonly consume the objects within this library and do not extend it. A license for either the ArcGIS Spatial Analyst extension or the ArcGIS Engine Runtime Spatial extension is required to work with objects in this library.