Introduction To Development With Arcgis

  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Introduction To Development With Arcgis as PDF for free.

More details

  • Words: 2,453
  • Pages: 55
Introduction to Development with ArcGIS Juan Castaneda Jonas Pålsson

EUC 2007 Technical Track

Agenda • ArcGIS products Overview • Development objects: ArcObjects • Development – COM – .Net – Java

EUC 2007 Technical Track

ArcGIS overview Applications

ArcGIS Desktop

Desktop Developer Kit .NET COM

ArcGIS Engine

Engine Developer Kit .NET COM C++

ArcObjects Services

ArcGIS Explorer

API .NET

Web Mapping Application

API .NET

Java

ArcGIS Mobile

SDK .NET

Java

ArcGIS Server

ArcGIS Online

Server Developer Kit .NET

COM

Java

ArcSDE technology

ArcWeb Services API REST

J2ME

OpenLS

SOAP

JavaScript

Desktop Personal for MS Access

File File

Personal

Workgroup

Enterprise

ArcSDE

Data (Geodatabase)

EUC 2007 Technical Track

Licensing • ArcGIS Desktop – ArcView, ArcEditor, ArcInfo

• ArcGIS Server – Functionality / Capacity

• Extensions – Desktop • 3D, Geostatistics, Network, Schematics Analyst; Publisher, Data Interop., Maplex, ArcPress, etc – Server • Network Analyst*, Data Interoperability*, Spatial Analyst**, 3D Analyst**

* = requires Standard or Advanced editions ** = requires Advanced edition EUC 2007 Technical Track

Editions and Levels of ArcGIS Server Capacity

Functionality

Level Workgroup • SQL Server Express • 10 users

Enterprise • Any supported database • Unlimited users

Basic features plus • Map, globe, geocoding, geoprocessing (ArcView tools) • Web ADF





Standard features plus • Advanced geoprocessing • Web editing • Mobile ADF (Enterprise level)





Edition Basic

Edition includes • ArcSDE • Geodata services for replication

Standard

Advanced

EUC 2007 Technical Track

ArcObjects • Fundation – Building blocks for ArcGIS – Users and programmers interact with the same objects

Point

Map Polygon Layer

EUC 2007 Technical Track

Pieces to create GIS applications or embed

• Technically they are called classes (or components) – – – –

Over 3,400 ArcObjects classes Over 21,000 properties and methods Grouped into over 70 logical libraries (not including ArcGIS Server)

• Each class corresponds to a basic GIS part Map

Point

Table

Layer

Line

Row

Polygon

Field EUC 2007 Technical Track

Map class vs map object • • • •

There is only one Map class, like for this car blueprint You make many map objects: Map and Sweden Counties. Using the blueprint to create car objects A class is code behind an object’s properties and methods Objects live in memory and take on your settings

Blueprint Objects

Map

EUC 2007 Technical Track

Where are ArcObjects? • ArcObjects is not a product, by itself • You can’t buy just ArcObjects – You buy an ArcGIS Desktop product – You buy ArcGIS Engine – You buy ArcGIS Server

• ArcObjects-related files are installed when you install one of the three products

EUC 2007 Technical Track

ArcObjects help • UML diagrams to organize ArcObjects – 3.400 ArcObjects classes in 70+ libraries – 110 posters

• Found at – Developer help – ArcObjects developer kit – Online • EDN Web site • Per library

EUC 2007 Technical Track

Reading diagrams

• Classes are rectangles • Classes have properties and methods • Get neighboring or connected objects pLayer = pMap.Layer(0)

1

Map (data frame) Layer Layer (index): ILayer AddLayer (ILayer)

0

2 3

* Feature Class

EUC 2007 Technical Track

ArcGIS architecture • All products share ArcObjects • Desktop extends the core ArcObjects functionality

ArcGIS Desktop

ArcGIS Engine

ArcGIS Server EUC 2007 Technical Track

Developing with COM

EUC 2007 Technical Track

ArcObjects classes are COM • COM compliant – – – –

Component object model Industry standard for creating classes Programming language independent COM classes can be reused between applications

• COM classes have programmer interfaces – Classes created in one language can communicate with other languages – ArcObjects classes are created in C++ – Use them in C++, VB.NET, C#.NET, VBA, Python, etc.

EUC 2007 Technical Track

Use COM compatible languages • VBA is built into the ArcGIS desktop applications – Visual Basic for Applications – VBA code is stored in map document files (mxd files)

• Buy a language and IDE (Development environment) – Visual Basic or C# (Visual Studio 2005) – C++

• Use a free open source language and IDE – Python

EUC 2007 Technical Track

COM classes have interfaces

• Objects are rectangles • Interfaces (lollypops) group properties and methods • Get neighboring or connected objects pLayer = pMap.Layer(0)

• Multiple interfaces Map IMap

Layer Layer (index): ILayer AddLayer (ILayer)

IMore

Other: Something

* Feature Class

EUC 2007 Technical Track

Understanding data types

Integer

• Intrinsic data types – Numbers, strings, dates

• Simple objects (VB, Excel, MapObjects) – One default interface _Button – Hidden IPoint • ArcObjects – Multiple interfaces

Button

Point

IGeometry

EUC 2007 Technical Track

Intrinsic data types and simple objects 'Intrinsic data Dim x As Integer x = 4 MsgBox x * 10

Integer

'Declare 'Set 'Use

'Simple Object Dim b as CommandButton 'Declare Set b = frmClock.cmdTime 'Set b.Caption = “Time” 'Use _CommandButton

+ (add) - (subtract) * (multiply) / (divide)

Commandbutton Color Enabled Font Caption ToolTip On a VBA form EUC 2007 Technical Track

Client and server environment • Client code instantiates a class • Client only knows the methods exist but does not know how they are implemented on the server Client code

Server class

Point IPoint

Dim p as IPoint Set p = New Point

IGeometry

X Y Z Projection

p.z = 5280 Third-party developer code (e.g., VBA)

Request services

DEMO

DLL OLB EXE EUC 2007 Technical Track

What COM interfaces provide • Programming language independence • The ability for functionality in applications to evolve over time – Add new interfaces without affecting client code – IDog, IDog2, IDog3, IDog4, IDog5 – Dim d as IDog works forever

• Interface reuse • Your classes can implement ESRI interfaces!

EUC 2007 Technical Track

Implement ESRI interfaces Interface

• Interface module

ESRI’s ArcObjects code Your code

Your Server MsgBox “Grr, Roof!”

• Class module – Implement methods – Write your own code

Client

• Developer module – Instantiate class – Call its methods EUC 2007 Technical Track

Developing custom COM components

• Find a similar ArcGIS component • Find out what interfaces it implements – Look in the Help

• Buttons implement ICommand

esriControlCommands

ArcMap Find

ICommand

FindButton

command

EUC 2007 Technical Track

Developer tools for component categories • Component Category Manager • Oleview

DEMO EUC 2007 Technical Track

API objects match your experience as a user • Programmers start the same place users start

Workspace FeatureDataset

FeatureClass

FeatureClass EUC 2007 Technical Track

API objects match your experience as a user • Programmers start the same place users start • Geodatabase API uses the same (user) terms • Includes any data, not just geodatabase formats Workspace FeatureDataset

FeatureClass

FeatureClass EUC 2007 Technical Track

Extend application & geodatabase • ICommand, ITool, IExtensionConfig/IExtension, IContentsView, IGxView • Class Extensions. – Custom Feature Classes – Custom Drawing – Custom property inspection – Validation – Custom Split Policies – Related object notification

• Registration of Custom class with Geodatabase (GUID) • Use CASE tools for class creation

EUC 2007 Technical Track

ArcGIS Engine Two Products • Engine Developer Kit is the toolkit for building custom GIS and mapping applications • Engine Runtime is deployable ArcObjects required to run custom Engine applications

EUC 2007 Technical Track

Developer Controls • MapControl • PageLayoutControl • ToolbarControl • TOCControl • ReaderControl • SceneControl • GlobeControl

EUC 2007 Technical Track

Tools and Commands More than 100 tools and commands included

EUC 2007 Technical Track

ArcGIS Engine Functionality • Read all supported ESRI data formats including the geodatabase • Map authoring (create and edit MXD) • ArcGIS level cartography • Query and analysis • Geocoding • Simple editing (shp and pGDB)

“ArcView without the applications” EUC 2007 Technical Track

Developer Libraries ArcGIS Server 9.2 • Components – Web ADF Native .Net Assemblies – ArcObjects primary Interop Assemblies

– ArcObjects COM type libraries

– Client-side support files • JavaScript • CSS • Images • Etc. EUC 2007 Technical Track

Developing with .Net

EUC 2007 Technical Track

1. Preinstallation – BEFORE installing ArcGIS

• .NET Framework 2.0 required to develop with .NET • Free download from MSDN

EUC 2007 Technical Track

2. ArcGIS Desktop installation

• ArcGIS applications and extensions –ArcMap, ArcCatalog, etc. – May require appropriate license

• Core type libraries • Primary interop assemblies • Controls –MapControl – PageLayout

EUC 2007 Technical Track

3. Desktop Developer Kit options • Different installs for language-specific components – COM – .NET – C++

• Help documentation • Tools • Samples • IDE integration components

EUC 2007 Technical Track

Using ArcObjects in .NET • Library architecture • COM concepts – Interfaces – GUIDs – Component Categories

• Using COM objects with .NET – COM Interop – COM Callable Wrappers – Runtime Callable Wrappers

• The Application architecture

EUC 2007 Technical Track

ArcObjects and the .NET API • All ArcObjects types are defined in .NET assemblies provided by ESRI – CCW - Com Callable Wrapper – RCW - Runtime Callable Wrapper

• Installed in GAC when ArcGIS is Interop installed • Not installed if .NET framework is not installed BEFORE ArcGIS is installed • Developer tools

.NET Assemblies (*.dll) COM Type Libraries (*.olb)

ArcObjects C++ (*.dll)

– ArcGIS Developer Help (.NET) – ILDASM.exe

EUC 2007 Technical Track

ArcGIS .NET assemblies and namespaces • All .NET projects must reference the ESRI assemblies – Eg., ESRI.ArcGIS.Carto.dll

• Import namespace to access ArcObjects .NET types – Eg., ESRI.ArcGIS.Carto

• Assemblies have dependencies 'Visual 'Visual Basic Basic .NET .NET uses uses the the 'Imports' 'Imports' keyword keyword Imports Imports ESRI.ArcGIS.CatalogUI ESRI.ArcGIS.CatalogUI Imports Imports ESRI.ArcGIS.ArcMapUI ESRI.ArcGIS.ArcMapUI Imports ESRI.ArcGIS.Framework Imports ESRI.ArcGIS.Framework .. .. .. 'Visual 'Visual C# C# uses uses the the ‘using' ‘using' keyword keyword using using ESRI.ArcGIS.CatalogUI ESRI.ArcGIS.CatalogUI using using ESRI.ArcGIS.ArcMapUI ESRI.ArcGIS.ArcMapUI using ESRI.ArcGIS.Framework using ESRI.ArcGIS.Framework

EUC 2007 Technical Track

.NET interfaces • .NET interfaces represent the ArcObjects interfaces • Different techniques for QueryInterface – Implicit casting – Explicit casting

• Use TypeOf to avoid handling InvalidCastException with Implicit casting geometry 'Implicit geometry == point point 'Implicit cast cast in in VB.NET VB.NET geometry geometry == CType(point, CType(point, IGeometry) IGeometry)'Explicit 'Explicit cast cast in in VB.NET VB.NET geometry geometry == point point as as IGeometry; IGeometry;

'Explicit 'Explicit cast cast in in C# C#

Dim Dim point point As As New New PointClass PointClass Dim geometry As IGeometry Dim geometry As IGeometry If If (TypeOf (TypeOf point point Is Is IGeometry) IGeometry) Then Then geometry geometry == point point End End If If EUC 2007 Technical Track

.Net base classes save time

Public Public NotInheritable NotInheritable Class Class RouteFinderCmd RouteFinderCmd Inherits BaseCommand Inherits BaseCommand …… Public Public Sub Sub New() New() MyBase.New() MyBase.New() MyBase.m_caption MyBase.m_caption == "RouteWindow "RouteWindow VB" VB" MyBase.m_category = "ArcObjects .NET MyBase.m_category = "ArcObjects .NET Tools" Tools" MyBase.m_message MyBase.m_message == "Toggles "Toggles view view for for the the RouteFinder RouteFinder window" window" MyBase.m_name = "ArcObjects .NET Tools_RouteFinderCmd" MyBase.m_name = "ArcObjects .NET Tools_RouteFinderCmd" MyBase.m_toolTip MyBase.m_toolTip == "Displays "Displays or or hides hides Route Route Finder" Finder" MyBase.m_bitmap = New System.Drawing.Bitmap _ MyBase.m_bitmap = New System.Drawing.Bitmap _ (Me.GetType.Assembly.GetManifestResourceStream (Me.GetType.Assembly.GetManifestResourceStream __ ("ESRI.ArcObjects.AAON.RouteFinderVB.RouteFinder.bmp")) ("ESRI.ArcObjects.AAON.RouteFinderVB.RouteFinder.bmp")) End Sub End Sub Public Public Overrides Overrides Sub Sub OnCreate(ByVal OnCreate(ByVal hook hook As As Object) Object) …… End End Sub Sub Public Public Overrides Overrides Sub Sub OnClick() OnClick() …… End End Sub Sub

DEMO EUC 2007 Technical Track

ArcGIS Engine Developer Kit for .NET

• SDK for developers to build custom ArcGIS applications • Includes the following: – ArcGIS Engine Runtime – .NET developer help system and Samples – Rich set of visual development components – Many pre-built commands, toolbars and menus

EUCUC 2007 Technical Track 2007 Tech Session

41

ArcGIS Server 9.2: Software Development Kit • Build and deploy web & enterprise geospatial applications and services • Productivity boost with out-of-the-box IDE integration • Software Development Kit (SDK) includes : – .NET components • Web ADF • Mobile ADF – Java components • Web ADF • Enterprise ADF Plus the ArcGIS Explorer SDK for custom tasks

Web map Applications

ArcGIS Mobile

Business Applications

Integration Environment

Mobile Web .NET

Web

Enterprise Java

Software Development Kit (SDK) EUC 2007 Technical Track

Web Application Development Framework • .Net libraries used to build Web GIS applications – Web controls • AJAX enabled – Support multiple data sources • ArcGIS Server, ArcIMS, ArcWeb, WMS • Web ADF graphics and consolidation classes – Task framework • Extensible architecture

• ArcGIS Server Manager – Build web applications

• Supported with .Net and Visual Studio 2005

EUC 2007 Technical Track

Developer Libraries ArcGIS Server 9.2

• Components – Web ADF Native .Net Assemblies – ArcObjects primary Interop Assemblies

– ArcObjects COM type libraries

– Client-side support files • JavaScript • CSS • Images • Etc. EUC 2007 Technical Track

ArcGIS Server for .Net – Building Mobile Apps

• Use the ArcGIS Server Mobile ADF – Developer solution for mobile Apps – Development of custom server-centric lightweight mobile apps – Direct synchronization with ArcGIS Server – Connected and disconnected – Mobile and desktop platforms – Short and long transactions, versioned editing

• Leverage Mobile Map controls • Leverage .Net Compact Framework • Work with GIS Web Services using the SOAP API • MS .Net/.Net compact Framework 2.0, WM 5.0 – pocket PC Smartphone, WM Pocket PC 2003, 2003 SE, CE 5.0 and XP DEMO EUC 2007 Technical Track

Developing with Java

EUC 2007 Technical Track

Java-COM Interop Bridge • Provides a Java API for ArcObjects – Generates Java classes for every ArcObjects class (Point) – Generates Java interfaces for every ArcObjects interface (IPoint) – Generates Java Proxy classes for every interface (IPointProxy)

• Allows Java applications to create ArcObjects and call methods on them using JNI technology

EUC 2007 Technical Track

Java in ArcGIS • ArcGIS Engine • ArcGIS Server

EUC 2007 Technical Track

Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. – Windows – Linux – Solaris

• Collection of libraries for mapping, visualization, data management and GIS analysis. • Create stand alone GIS apps or Embed GIS functions in existing applications

EUC 2007 Technical Track

Architecture Java Proxies & Visual JavaBeans Interop Bridge ArcObjects

Windows / Solaris / Linux EUC 2007 Technical Track

ArcGIS Server 9.2 Java • Web ADF – Java Server Faces

• Enterprise Application Development Framework – Supports development of J2EE applications powered by Enterprise JavaBeans (EJB) technology by providing out-of-the-box EJBs ready to use

• Web services

EUC 2007 Technical Track

More Info • Visit – EDN http://edn.esri.com – Documentation – Conference proceedings

EUC 2007 Technical Track

Summary • ArcObjects are the base for all the ArcGIS applications • ArcObjects come with a product: ArcGIS Desktop, ArcGIS Engine or ArcGIS Server • According to your needs select the product and the license • Several supported technologies for development

EUC 2007 Technical Track

Questions?

EUC 2007 Technical Track

Thank you for coming!

EUC 2007 Technical Track

Related Documents