IWorkspaceFactoryStatus

May 13, 2008

A couple of times in my recent past, I have experienced issues when I have a long running process working on SDE data that suddenly crashes.  On adding detailed logging in the code, I pinpointed the issue to the SDE connection being lost between the workstation and the server. One possible reason was our backup systems kicked in at mid-night causing the database to disconnect or maybe a network issue.

To add fault-tolerance in such cases, IWorkspaceFactoryStatus is a very handy interface. IWorkspaceFactoryStatus.WorkspaceStatus gives the current connected status to the SDE geodatabase. If the connection status is esriWCSDown, then use PingWorkspaceStatus method to check if the workspace can be reconnected to. If the PingWorkspaceStatus method returns a WorkspaceStatus of available, the open a new workspace. It is important to note that the old workspace can not be reclaimed.

ESRI Documentation is here and an interesting blog post on the topic is here


What’s Coming in ArcGIS 9.3

April 30, 2008

A very useful link listing all the new features coming in ArcGIS 9.3.

Here is the link (http://www.esri.com/software/arcgis/about/whats-coming.html)


Converting ESRI ITable to .NET DataTable

April 30, 2008

Ran into this interesting ArcObjects utility class yesterday.
To convert records of an ITable to an inMemory DataTable, use ESRI.ArcGIS.Utility.Converter.ToDataSet.

This works really well for data viewing.
However this interface seems to be now depracated and replaced with ESRI.ArcGIS.ADF.
The ToDataSet method is missing in the new interface.

Sample code:
ITable table = featureWorkspace.OpenTable(tableName);
IRecordSetInit recordSetInit= new ESRI.ArcGIS.Geodatabase.RecordSetClass();
recordSetInit.SetSourceTable(table, new QueryFilterClass());
IRecordSet recordSet= recordSetInit as IRecordSet;

System.Data.DataSet netDS = ESRI.ArcGIS.Utility.Converter.ToDataSet(recordSet);


Five Best Practices for Maintaining an ArcSDE Geodatabase

April 29, 2008

ArcSDE team has a very good blog posting on best practices for maintaining an SDE geodatabase. A must read for all users who are involved with working and maintaining geodatabases.

Here is the link
(http://blogs.esri.com/Dev/blogs/geodatabase/archive/2008/04/03/Five-Best-Practices-for-Maintaining-an-Enterprise-Geodatabase.aspx)


ISRO creates record with 10-satellite launch

April 29, 2008

The Indian Space Research Organisation (ISRO)  on Monday put in orbit Cartosat-2A, the remote sensing satellite with the best-ever Indian imagery resolution of 0.8 metre.

The same PSLV-C9 launcher delivered nine other satellites — the experimental Indian Mini Satellite IMS-1 and eight tiny commercial satellites — into a 637-km near-Earth orbit. This is the first time that 10 satellites have been launched in a single mission.

The eight nanosats were built by universities in Canada, Denmark, Germany and the Netherlands. Called NLS-4 (a cluster of six), NLS-5 and RUBIN-8, they together weigh 50 kg. ISRO’s commercial arm Antrix Corporation charged $600,000 (about Rs 2.4 crore) for their launch.

Next up, India’s first mission to moon CHANDRAYAAN – 1 scheduled for Q3 2008.


ArcMap: Working with multiple DataFrames

April 26, 2008

(From ESRI) The viewer window is a new window that was introduced at 9.2 to enable users to work with one data frame at multiplescales. In the 9.2 release if you opened a viewer window and then activated a different data frame in your map document, the viewer window was automatically closed. In Service Pack 2, ESRI has enhanced viewer windows so that you can use them to view inactive data frames. Now if you activate a different data frame while a viewer window is open, that viewer window remains on-screen, enabling you to work with multiple data frames side by side.

When you work with an inactive data frame in a viewer window, you can easily make the viewer show the same location that is currently displayed in the active data frame in the main ArcMap window. Similarly, you can update the location shown in the active data frame in the main ArcMap window to match the location shown in any of your viewer windows.

The ability to work with multiple data frames side-by-side in ArcMap can be useful for analysis, historical change assessment, data evaluation, and other applications where you want to be able to see different datasets for the same area side by side, as opposed to working with all the data in one data frame, or working with multiple map documents.

Pictures and more details demonstrating this can be found here

http://downloads.esri.com/support/downloads/other_/Whats_New_In_ArcGIS_92_Service_Packs-v5.pdf


Add layer to Map with “autoArrange”

April 16, 2008

One of the very common operations programmers do in ArcObjects is adding a layer to the Map. To do this there are two ways, one using IMap.AddLayer or IMapLayers.AddLayer.

IMap.AddLayer adds the new layer on the top of all the layers in the map. This is not very useful as we normally want the point layers at the top followed by polyline followed by polygon layers. Adding polygon layers at the top would mask all other layers below.

IMapLayers.AddLayer is preferable because it has an option to autoArrange the newly added layer in the table of contents. If autoArrange is set to TRUE, the layer is added in the proper position as by its weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type – Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.


Unit Testing with ArcGIS

January 14, 2008

As a part of writing any unit-test to test the add-ins (buttons/tools/extensions) and their behavior in ArcMap, it is essential to automate starting ArcMap and running the commands. Here is a good article on how to automate ArcMap.


What’s new in Visual Studio 2008

November 13, 2007

With the release of Vs 2008 around the corner, this is a good site to know what is new in the product

http://msdn2.microsoft.com/en-us/library/bb386063(VS.90).aspx


Setting a field to null in SQL Server Enterprise Manager

October 30, 2007

We always end up in a situation where we need to update a value directly in the recordset and set it to null. E,g. when we are dealing with DateTime fields and wish to set the field to null. If you just leave the field blank and try navigating to the next row, SQL Server throws an error.

To explicitly set a value to null, click on the field in the resultset and type CTRL-0 (zero). This sets the field to null.
In SQL Server 2005 Management Studio, do not forget to click on Execute button to save the edits.