+ All Categories
Home > Documents > Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best...

Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best...

Date post: 24-May-2018
Category:
Upload: dinhbao
View: 219 times
Download: 2 times
Share this document with a friend
44
DevSummit’06 Easy ArcObjects Turbocharging Brian Goldin Erik Hoel Easy
Transcript
Page 1: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Easy ArcObjects

Turbocharging Brian GoldinErik Hoel

Easy

Page 2: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Purpose of this talk

• How to get things done quick while your boss thinks it’s hard agonizing work– Save time– Be efficient– Write less code– Separate the model

builders from the coders

Page 3: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

IDEs

Page 4: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Visual Studio IDE• Visual Studio IDE integration makes life easy

– Implements that boiler plate code for you• Licensing• Implement common interfaces• Base classes• Adding references over and over again

– Preconfigured templates• All applications start in the same place – use this as your

foundation• Prototype code not typing boiler plate code

– If you like to hack things the framework is very extensible – check it out…

Page 5: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

JAVA IDE

• Lots of templates• Very slick help system• Code snippets• Lots of wizards

Page 6: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Configure your app with ArcMap

• Author maps its fun and easy• Use layer files

– Create a FeatureLayer or use a layer file– Some layers can be excessively complicated

• Work with symbols– Roll your own use one that you’ve configured

Page 7: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Geoprocessing

Page 8: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Geoprocessing

• Geoprocessing has many benefits– Lots of functionality is encapsulated into a

single tool– Tool implementation is robust and efficient– Great opportunity to delete code and simplify

implementation

Page 9: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

4 Ways to Leverage Geoprocessing

• Use Existing Tools• Build Models• Write Scripts• Create new tools

Page 10: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Execute, Execute, Execute

• Tools are grouped into logical collections– Analysis - extract, overlay, proximity etc.– Data Management - create and manage data– Conversion - load data– Network Analysis– Spatial Analysis– Cartography– And the list goes on….

Page 11: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Geoprocessing Example – Buffer• Fine grain ArcObjects call to Buffer Features

– Huge learning curve– Painful– Error Prone– Appropriate when you need to fine control but not

unnecessary• Using Geoprocessing to Buffer Features

– Simpler– Easier to debug and understand– Bullet proof code

Page 12: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Execute more than just tools

• Build workflow with model

Page 13: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Execute More than Tools cont.

• There’s Logic in using scripts

Page 14: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Create your own geoprocessing tools

• It’s easy to extend geoprocessing with your own tools– Script Tool– Model Tool– Custom Tool

Page 15: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

How do you get started

• Read the desktop help for a conceptual understanding

• API Reference

Page 16: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Cursors

Page 17: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Cursors• Used when searching a table• Cursor is returned as result of applying a

QueryFilter to a Table• Client then iterates through the returned

rows in the cursor• Cursors come in different flavors

– Search, update, and insert• Update cursors take an argument

– Recycling or non-recycling

Page 18: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Cursors• Search cursors return rows as specified by

the QueryFilter• Update cursors used to update or delete

rows specified in the QueryFilter• Insert cursors used to insert new rows into

a table– Good for bulk loading simple data– Slower for non-simple data– Consider object loader

Page 19: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Recycling vs. Non-recycling• Recycling

– Allocate a single row object (re-load on each fetch)

– Should only be used for reading data– Performance advantages– Recycling Update Cursor can be faster then

calling Store() on rows from a Search Cursor• Non-Recycling

– Different row object on each fetch– Always has full set of fields

Page 20: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Cursors vs. get_Feature

• In ArcObjects, there are often several ways to accomplish the same task– some are much faster than others

• Retrieving features given a set of ObjectIDs

• Significant performance differences

Page 21: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

QueryDefs vs. OpenTable• IFW::OpenTable()

– Acquires schema lock on data source – costly serialized process; many SQL statements

– Serialization kills scalability, can create queues with many (e.g., 100s) users

• QueryDefs– No schema locks– Fast creation of rowset

• Pabst vs. Heineken

Page 22: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Component Burn

Page 23: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Component Burn

• Easy to consume the ArcObjects fine grained components in an unoptimizedmanner

• Many ways to do the same task• Unnecessarily cocreating small

components can whack performance• Use coarse grained components when

possible

Page 24: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Data Models

Page 25: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Data Models

• Data model structure is critical• Minimize the number of feature classes

– Cursors are expensive– Utilize subtypes– Subtypes not for you? Consider fat classes

• handle unpopulated attributes

• Avoid classes containing small number of large features– Nation or state polygon

Page 26: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Data Models

• Model only those relationships that are important

• Event notification can have impact– relationship classes– feature linked annotation– workspace and class extensions– editor events

Page 27: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Data Models

• Dense features (high vertex count) impact– E.g., 8 million vertex polygons– Display pipeline, geoprocessing, updating,

etc.• Extremely large features (extent) impact

– Nation or state polygon– Topology, networks

Page 28: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Prototyping

Page 29: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Prototyping• Largest mistake made with the geodatabase• Structure is critical – data quantity is not• Prototype as soon as a first pass model is

available– general structure; small details unimportant– load a modest amount of data (on versioned SDE)– empty classes are OK

• Try editing, observe system performance• Repeat this process as necessary

Page 30: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Extensibility and Customization

Page 31: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Levels of GDB Customization

Subtypes& defaults

Domains& validation

Connectivity& topo rules

Class & workspaceextensions

Built-in

Functionality

Custom

Applications

VBA

Programming

starts here

Page 32: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Levels of GDB Customization

• Application level– Pros

• Business Logic is stored within application• Can access data without customization

– Cons• Only available when application is running• Users do not always interact with application

customization

Page 33: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Levels of GDB Customization

• Database level– Pros

• Business Logic is stored with data• Always available, regardless of application

– Cons• One class extension per feature class• All users require dll to even view data• Database is unusable if code fails• Impacts on performance

Page 34: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

GDB Extensibility

• Five mechanisms– Workspace extensions

• Filtering, edit events, version events– Class extensions

• Drawing, split policies, property inspector, related object creation notification

– Plug-in data sources– OLE DB providers– Custom features

Page 35: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Class extension uses• Schema generation • Custom drawing• Custom property inspection and validation• Custom split policies• Related object creation notification• PlugIn Data Sources

Page 36: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Miscellaneous Stuff

Page 37: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Workflows

• Workflow is critical with versioning• Recommended workflow:

– Load data– Define the dataset (e.g., topology, GN)– Build or process the entire dataset (e.g.,

validate entire topology, build the GN)– Register the dataset as versioned

Page 38: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Caching

• Spatial cache– Features– E.g., network editing

• Schema cache– GDB schema tables– E.g., creating a checkout version

programmatically

Page 39: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

GP Tools

• Consider periodic GP tools for QA/QC– Not everything has to be in the data model or

in code– Avoidance of large polygons (e.g., nation or

state• Run Integrate to ensure data planarity and

cluster your vertices– Not necessary to create a topology

Page 40: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Is your PC worth > $10 on eBay?

• Would people buy it only to create a novelty fishtank?

• Run on a decent PC– e.g., spend $500

at Walmart

Page 41: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Questions?

Page 42: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06Best Villain?

Emilio Largo

Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3

Rosa Klebb Auric Goldfinger

Page 43: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Emilio Largo

Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3

Rosa Klebb

No, Mr. Bond. I expect you

to die.

Auric Goldfinger

Best Villain?

Page 44: Easy ArcObjects Turbocharging - Amazon S3 · Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3 Best Villain Rosa Klebb Best Villain? Goldfinger No, Mr. Bond. I expect you to die. Title:

DevSummit’06

Emilio Largo

Ernst Blofeld 1 Ernst Blofeld 2 Ernst Blofeld 3

Best Villain

Rosa Klebb

Best Villain? Goldfinger

No, Mr. Bond. I expect you

to die.


Recommended