Tuesday, December 16, 2014

ArcObjects Recycled Cursors

If you are new to ArcObjects, you must have seen this Boolean parameter when you want to create a search cursor. This might be confusing for some new developers. I didn't know about it in the beginning so I used to insert a false there every time.

Actually this very Boolean parameter can really ruin your entire application and produce unexpected results if used in the wrong context.

What is Recycling?
Recycling is reusing the same memory location for creating features or rows.


When to use Recycling?
Recycling cursor is much more efficient than non-recycling one. It is great for populating lists and printing values in the screen.

Here are some cases you want to use Recycling in
  • Populating Features' attributes in a list
  • Saving certain primitive features attributes (like objectid) in a collection

When not to use Recycling?
When capturing the feature or its geometry (or any other non-primitive reference) , DO NOT use Recycling cursor. If you did you will simply get the same feature (probably the last one) in all your collection because it is using the same memory location.

Here are some cases you must not use Recycling in
  • Union the geometry of all features in a given cursor
  • Saving the feature geometry in the Grid Tag or collections
  • Comparing features

I even made you a video guys!


Hope that helped!

Extending ArcObjects with .NEt (IGeometry) - 09 - Searching the Geodatabase

In this episode we talk about how to search restaurants by name, filter them on the map as we type in the name of the restaurant. 

Interfaces introduced in this episode: None

====
Previous episode with code 
http://www.youtube.com/watch?v=h7TYtS...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/b1wdh57g342...


Enjoy



Sunday, December 14, 2014

Extending ArcObjects with .NET (IGeometry) - 08 - Flashing Geometry

This episode we will learn how to flash restaurants geometry on the map. We learn how to draw the point geometry on the screen and customize the pen to change the size and the color. The NOT XOR pen will allow you to draw over the same color which will make the color disappear simulating a flashing process.

Interfaces introduced in this episode: IGeometry, IRGBColor, ISymbol, IMarkerSymbol


Enjoy



Friday, December 12, 2014

Extending ArcObjects with .NET (IGeometry) - 07 - Selecting Features

In this short episode we learn how to interact with the map from our form. We will learn how to select a feature, clear existing selection and refresh the map so we can show the selection

Interfaces introduced in this episode: None

====
Previous episode with code 
http://www.youtube.com/watch?v=XT1LqH...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/d8rhjgh1we4...



Wednesday, December 10, 2014

Extending ArcObjects with .NEt (IGeometry) - 06 - Object Oriented and GIS

First introduction of Object Oriented concepts with ArcObjects. We create the category and restaurant class to wrap the ArcObjects and populate them dynamically in drop down lists. We remove the hard code coded categories and replace them with a dynamic subtype auto fill. 

Interfaces introduced in this episode: ISubtypes and IEnumSubtype

====
Previous episode with code 
http://www.youtube.com/watch?v=saixbj...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/uxva0bj8fph...

Enjoy


Monday, December 8, 2014

Extending ArcObjects with .NET (IGeometry) - 05 - Filtering Queries

his short episode introduces the concept of filtering queries. We talk and discuss the IQueryFilter and IFields interface. We do that by adding a new functionality to our Bestaurants application to filter restaurants by their category

Interfaces introduced in this episode: IFields, IQueryFilter

====
Previous episode with code 
http://www.youtube.com/watch?v=avbKHJ...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/57wvn1hgbe9...

Enjoy



Saturday, December 6, 2014

Extending ArcObjects with .NET (IGeometry) - 04 - Querying Features

We fix the form-hiding-behind-arcmap problem by forcing the form to be the child of ArcMap. Also this is our first encounter with Feature Classes, Feature Cursor and yes Features. We will learn how to get the feature class, use it to query and get a feature cursor which will give us individual features to loop through. New Interfaces introduced in this episode, IFeatureClass, IFeatureCursor and IFeature 

Interfaces introduced in this episode: IFeatureClass, IFeatureCursor, IFeature 

====
Previous episode with code 
http://www.youtube.com/watch?v=QCpEKW...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/yiggh6ky3aw...


Enjoy


Thursday, December 4, 2014

Extending ArcObjects with .NET (IGeometry) - 03 - Filtering Layers

We explain more interfaces today, and how layers can implement multiple interfaces for different functionalities. We will also filter the restaurants by category using the IFeatureLayerDefinition interface. 

Interfaces introduced in this episode: IFeatureLayerDefinition 

====
Previous episode with code 
http://www.youtube.com/watch?v=sMxkNI...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/1l92ha5lo0v...

Enjoy



Monday, December 1, 2014

Extending ArcObjects with .NET (IGeometry) - 02 - Working with Layers

This lengthy episode is our first encounter with data. We create an ArcMap document and add the Bestaurants data to it, change symbology and prepare it for programming.

We explain the ImxDocument, IMap and ILayer interfaces in this video. We create a new button and add it to our toolbar, the button opens a new form that have a drop down list. We writes our first code that reads all the current layers in the map and populates them in the list. 

Then we work with the layers from within the form. We will learn how to hide and show the layer from the active view in the map and also learn that to apply these changes we have to call methods on both the document and map object in order to refresh and see the changes we do! 

Interfaces introduced in this episode: IDocument, IMap, ILayer

====
Previous episode with code 
http://www.youtube.com/watch?v=XrZs1r...

Bestaurants Geodatabase 
https://www.dropbox.com/s/ywg4l7zj6cf...

The Source Code as of the end of the Episode
https://www.dropbox.com/s/7eh3dfbnl8y...


Enjoy