2008-03-25 - arcobjects, matt marsik.pdf

Upload: eslam-ali

Post on 14-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    1/22

    A Brief Tour of ArcObjects and ArcGIS

    intro to arcobjects

    reading the object model diagram

    vba editor for arcgis

    maps

    types of data layers

    tables and fields

    Matt MarsikDepartment of GeographyMarch 25, 2008

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    2/22

    Why ArcObjects?ArcObjects is one development platform for

    ArcGIS Desktop.

    ArcObjects is the development platform for

    the ArcGIS family of applications such asArcMap, ArcCatalog, and ArcScene.

    ArcObjects is a framework that lets you

    create domain-specific components from

    other components.

    Learning ArcObjects allows you to pick

    apart existing scripts to understand

    rocess flow and create new scri ts.

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    3/22

    Classes and objectsThere are 3 types of classes shown in the UML

    diagrams

    abstract classes, co classes, and classes.

    A coclass represents objects that you can directlycreate using the object declaration syntax (the New

    . ,

    Set pPoint = new Point

    A class cannot be created with New, but objects can becrea e as a proper y o ano er c ass or y unc ons

    from another class.

    Set pMxDoc = ThisDocument

    An abstract class cannot be used to create new objects,but it is a specification for subclasses.

    eg: line could be an abstract class for

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    4/22

    Type Inheritance Type inheritance defines specialized classes that share properties and

    methods with a super class and have additional properties and methods.

    This diagram shows that a primary line (creatable class) and secondary line

    (creatable class) are types of a line (abstract class).

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    5/22

    Instantiation

    Instantiation specifies that one object from one class has a method with

    which it creates an object from another class.

    A common way to get at additional properties and methods

    A pole object might have a method to create a transformer object.

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    6/22

    Interpreting object model diagramsArcObjects object model diagrams are

    based on the UML notation, an industry-

    diagramming standard for object-oriented

    analysis and design.

    The development environment, Visual

    ,

    and members but does not show the

    structure of those classes.

    ese agrams en ance your

    understanding of the ArcObjects

    components.

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    7/22

    Object model diagrams: The Key

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    8/22

    Our ArcObjects Testbed

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    9/22

    Getting at the VBA editor for ArcMap

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    10/22

    VBA Editor Revealed and the Autocode Completion helper

    Autocode Completion

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    11/22

    Getting At Layers Iterating Through an Enumeration of Layers

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    12/22

    Enumerators IEnumLayer example

    Enumerators are similar to

    collections but do not have as

    Does not have properties Count or

    Item

    Next returns next ILayer

    Reset moves to the top of

    enumeration

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    13/22

    Getting At Layers Instantiations of ILayer

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    14/22

    Collections IMap and ILayer examples

    Collection of maps or layers

    Each collection item is numbered

    Reference items by index number(not by name)

    Count layers in collection

    Get a layer with an index number

    Methods

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    15/22

    Collections ILayer and selected layers

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    16/22

    Collections IFeatureLayer and IFields

    Feature classes have attribute

    tables

    Need to get table from feature

    class

    Tables contain a Fields collection

    Fields collection is composed of

    fields

    properties

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    17/22

    IFields: Whats Next?

    Instantiate more

    interfaces:

    ITable

    ICursor

    IRow

    IQueryFilter

    Why? To create

    selections, edit table cellsan summar ze e s

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    18/22

    IFeatureLayer: Whats Next?

    Instantiate more

    interfaces:

    IWorkspaceName

    IFeatureClassName

    ITable

    Why? Perform spatial

    operations between 2 or

    more vector layers

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    19/22

    Getting At Raster Layers Instantiation of IRasterLayer

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    20/22

    IRasterLayer

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    21/22

    IRasterLayer Whats Next?

    Instantiate more

    interfaces:

    IRaster

    IRasterDataset

    IRasterWorkspace

    IRasterBands

    IRasterProps

    Why? To get at moreraster properties and to

    create and edit rasters

    programatically

  • 7/27/2019 2008-03-25 - ArcObjects, Matt Marsik.pdf

    22/22

    Whats next?

    Anythings possible!

    C:\Program Files\ArcGIS\DeveloperKit\Help\VB\VB6_Desktop.chm

    Object Model Diagrams

    C:\Program Files\ArcGIS\DeveloperKit\Diagrams

    Check out existing VBA scripts for ArcGIS. .

    Look on Discussion fourms for more info/help

    http://support.esri.com/index.cfm?fa=forums.gateway

    Integrating Python and ArcObjects

    http://www.codeplex.com/IronPython