Hussein Nasser's Blog, page 13

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 listSaving 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 cursorSaving the feature geometry in the Grid Tag or collectionsComparing features
I even made you a video guys!


Hope that helped!
 •  0 comments  •  flag
Share on Twitter
Published on December 16, 2014 03:23

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



 •  0 comments  •  flag
Share on Twitter
Published on December 16, 2014 03:18

December 14, 2014

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

This episode we will learn how to flash restaurants 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


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

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

Enjoy



 •  0 comments  •  flag
Share on Twitter
Published on December 14, 2014 03:17

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...



 •  0 comments  •  flag
Share on Twitter
Published on December 12, 2014 03:16

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


 •  0 comments  •  flag
Share on Twitter
Published on December 10, 2014 03:15

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



 •  0 comments  •  flag
Share on Twitter
Published on December 08, 2014 03:13

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


 •  0 comments  •  flag
Share on Twitter
Published on December 06, 2014 03:12