Presentation is loading. Please wait.

Presentation is loading. Please wait.

GIS in Water Resources Consortium Attaching Behavior to Objects and Programming in the Geodatabase Tom Wesp, AICP Henry Hagemeier ESRI San Antonio.

Similar presentations


Presentation on theme: "GIS in Water Resources Consortium Attaching Behavior to Objects and Programming in the Geodatabase Tom Wesp, AICP Henry Hagemeier ESRI San Antonio."— Presentation transcript:

1 GIS in Water Resources Consortium Attaching Behavior to Objects and Programming in the Geodatabase Tom Wesp, AICP Henry Hagemeier ESRI San Antonio

2 GIS in Water Resources Consortium Parcels and Buildings Two separate layers Each with its own attributes and independent of each other.

3 GIS in Water Resources Consortium Wouldn’t It Be Nice… What if we could change the properties of one layer and the properties of the other would be automatically updated?

4 GIS in Water Resources Consortium Our Example Parcels and Buildings Parcel has a field that “keeps track” of combined cost of buildings on it.

5 GIS in Water Resources Consortium Programming Custom Objects Custom objects requires programming in COM-compliant languageCustom objects requires programming in COM-compliant language –only VC++ or Delphi (don’t ask about VB) –custom object classes can use VB or VJ++ CASE tools make it easierCASE tools make it easier Custom objects requires programming in COM-compliant languageCustom objects requires programming in COM-compliant language –only VC++ or Delphi (don’t ask about VB) –custom object classes can use VB or VJ++ CASE tools make it easierCASE tools make it easier

6 GIS in Water Resources Consortium Custom Objects Developers create custom objects and intricate data schemasDevelopers create custom objects and intricate data schemas No difference between ESRI supplied and developer-supplied custom objectsNo difference between ESRI supplied and developer-supplied custom objects –merely support required interfaces –augments with new interfaces Developers create custom objects and intricate data schemasDevelopers create custom objects and intricate data schemas No difference between ESRI supplied and developer-supplied custom objectsNo difference between ESRI supplied and developer-supplied custom objects –merely support required interfaces –augments with new interfaces

7 GIS in Water Resources Consortium Custom Objects What you will needWhat you will need –UML and MS Repository aware CASE tool Visio Professional or EnterpriseVisio Professional or Enterprise –Visual C++ or Delphi –GeoDatabase data model diagram –ArcCatalog –OO programming skills and knowledge of COM What you will needWhat you will need –UML and MS Repository aware CASE tool Visio Professional or EnterpriseVisio Professional or Enterprise –Visual C++ or Delphi –GeoDatabase data model diagram –ArcCatalog –OO programming skills and knowledge of COM

8 GIS in Water Resources Consortium Creation Process Create the object modelCreate the object model –3rd party CASE tool Export to the Microsoft RepositoryExport to the Microsoft Repository –3rd party CASE tool UML export wizard Generate stub-codeGenerate stub-code –ESRI supplied wizard (VC++ only) Implement custom behaviorImplement custom behavior –you program into the stubs Create the GeoDatabase schemaCreate the GeoDatabase schema Create the object modelCreate the object model –3rd party CASE tool Export to the Microsoft RepositoryExport to the Microsoft Repository –3rd party CASE tool UML export wizard Generate stub-codeGenerate stub-code –ESRI supplied wizard (VC++ only) Implement custom behaviorImplement custom behavior –you program into the stubs Create the GeoDatabase schemaCreate the GeoDatabase schema

9 GIS in Water Resources Consortium Creation Process Base it on a GeoDatabase objectBase it on a GeoDatabase object –give it custom behavior, properties Base it on a GeoDatabase objectBase it on a GeoDatabase object –give it custom behavior, properties ESRI provides this... You do this...

10 GIS in Water Resources Consortium Custom Object Example Feature Object Model COM Implementation

11 GIS in Water Resources Consortium Custom Object Example Feature Tree Height Kind Object Model COM Implementation Age()

12 GIS in Water Resources Consortium Custom Object Example Feature Tree Height Kind Feature Object Model Interface F1 Interface F2 COM Implementation Age()

13 GIS in Water Resources Consortium Custom Object Example Feature Tree Height Kind Feature Object Model Interface F1 Interface F2 Interface F1 Interface F2 Height Kind Tree Interface T COM Implementation Age()

14 GIS in Water Resources Consortium Custom Object Example Feature Tree Height Kind Feature Object Model Interface F1 Interface F2 Feature Interface F1 Interface F2 Height Kind Tree Interface T COM Implementation Age()

15 GIS in Water Resources Consortium Visual - Almost Real - Hands on Demonstration Tools we will use…Tools we will use… –Visio for UML (Unified Modeling Language) –Visual C++ for code creation –ArcMap to implement and view the new behavior

16 GIS in Water Resources Consortium Our Custom Object ArcInfo provides tools for creating buildings and land parcels as polygons.ArcInfo provides tools for creating buildings and land parcels as polygons. ArcInfo allows us to store attribute data about those buildings and parcels.ArcInfo allows us to store attribute data about those buildings and parcels. We want to create a custom object which will do the following…We want to create a custom object which will do the following… –Parcels store land value along with value of all building on that parcel –Buildings store the floors, height, and value

17 GIS in Water Resources Consortium But Wait! There’s more! We want the features to maintain their relationship automatically…We want the features to maintain their relationship automatically… For Example:For Example: –If a new building is created the parcel attributes will automatically be updated with the building’s value

18 GIS Resources in Water Adding ESRI Geodata access COM classes with Visio UML Tools ESRI Classes::Object ESRI Classes::Feature Click and drag

19 GIS in Water Resources Consortium Adding a Custom Class with Visio’s UML Tool Name Object and add attributes from dialog box. Double clicking on the object opens the dialog box.

20 GIS in Water Resources Consortium Drag and drop a Generalization to connect the new Parcel class to Feature

21 GIS in Water Resources Consortium Add a COM Interface to the Parcel Object Give interface a name and set its Stereotype to Interface

22 GIS in Water Resources Consortium Interface for the Parcel object will allow us to read and write parcel value and read values of all buildings on that parcel Drag and drop a Refinement to connect interface IParcel to Parcel Class

23 GIS in Water Resources Consortium Add operations to the Interface IParcel Adding an operation called get_CombinedBuildingValue

24 GIS in Water Resources Consortium Same previous steps to create interface for Custom Building Behavior

25 GIS in Water Resources Consortium Create a RelationshipClass to associate parcels to buildings The composite association tool in Visio creates the needed relationship between the buildings and parcels.

26 GIS in Water Resources Consortium Finally create a ClassExtension for implementing behavior A Class Extension is a COM class that implements behavior for a whole set of custom features in a feature class.

27 GIS in Water Resources Consortium Finished UML Model Export the UML model to the Microsoft Repository (in this case an Access database).

28 GIS in Water Resources Consortium Now what? We have our object model in a Repository. What’s next? We need to generate code…We need to generate code… –We will use Microsoft Visual C++ with a little help from an ESRI wizard with a little help from an ESRI wizard

29 GIS in Water Resources Consortium Start Microsoft Visual C++ Go to the “Tools” menu and choose “customize”. Click on the Add-ins tab and browse to the ArcInfo directory that contains the file “CodeGenWiz.dll” and load the dll.

30 GIS in Water Resources Consortium Visual C++ with ESRI CodeGenWizard Browse to your Access database that contains your object model.

31 GIS in Water Resources Consortium Select your object model…

32 GIS in Water Resources Consortium Defining custom feature properties with the wizard

33 GIS in Water Resources Consortium Continue with the wizard to define Inherited Interfaces Aggregation: Inner feature is called directly. (A little like OO inheritance) Containment: Calls are “forwarded” to the inner feature.

34 GIS in Water Resources Consortium Define a Developer Studio Project and compile a dll Feels good to finally have some code.

35 GIS in Water Resources Consortium All that is left now is to add some C++ code. Define Object Behavior Define Object Functions

36 GIS in Water Resources Consortium Well… there is a little more Use ArcCatalog Case Tool Wizard to create a database schema from your UML model.Use ArcCatalog Case Tool Wizard to create a database schema from your UML model. –Connect to the Repository –Select the object model –Define schema properties for each feature –Create the schema

37 GIS in Water Resources Consortium Adding Case Tool in ArcCatalog Click and drag Case tool from Customize dialog box.

38 GIS in Water Resources Consortium Schema Wizard in ArcCatalog Navigate to the Repository containing your UML model.

39 GIS in Water Resources Consortium Schema Wizard Shows Custom Features, Relationship Classes and Domains.

40 GIS in Water Resources Consortium ArcMap

41 Thank You


Download ppt "GIS in Water Resources Consortium Attaching Behavior to Objects and Programming in the Geodatabase Tom Wesp, AICP Henry Hagemeier ESRI San Antonio."

Similar presentations


Ads by Google