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

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


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.