ESRI ArcGIS Server Java Script API, Geoenrichment

It’s not hard to create a map and overlay one set of data on it – well, at least not with ArcGIS Online. But what if your users really want to see several types of data, such as demographics, just around particular spots on the map, so they can easily hone in on what matters and compare apples to apples from one spot’s data to another? They could be kind of stuck without a developer like you.

| 1 Comment

Switch on labels

Here is a small piece of code, which can be used to switch on labels. Why do I feel it to be on the post?  Well, due to its simplicity. Have a look: –

Public Sub SwitchOnLabels(pFeatLayer As IFeatureLayer, DisplayField As String)

Dim pGFLayer As IGeoFeatureLayer
Set pGFLayer = pFeatLayer

Dim pLabelEngine As ILabelEngineLayerProperties
Set pLabelEngine = New LabelEngineLayerProperties
Dim pAnnoLayerProps As IAnnotateLayerProperties

Set pAnnoLayerProps = pLabelEngine
Set pAnnoLayerProps.FeatureLayer = pGFLayer

Dim exp As String
exp = "[" & DisplayField & "]"
pLabelEngine.Expression = exp
pLabelEngine.IsExpressionSimple = True
pGFLayer.AnnotationProperties.Add pLabelEngine
pGFLayer.DisplayAnnotation = True
End Sub

Posted in ArcObjects with Visual Basic | Leave a comment


The following VB 6.0 sub- procedure can be used to dissolve features based upon desired attribute fields: –

Public Sub GPDissolve(strIn, strOut, disField As String)

On Error GoTo EH
Dim GP As IGeoProcessor
Set GP = New GeoProcessor

GP.OverwriteOutput = True

Dim GPU As IGPUtilities
Set GPU = New GPUtilities

'Declare and set a variant array to hold the parameters
Dim parameters As IVariantArray
Set parameters = New VarArray

'Populate the variant array with the parameters
parameters.Add strIn '(in_features)
parameters.Add strOut '(out_feature_class)
parameters.Add disField '(dissolve_field)
parameters.Add "AREA SUM"

'Now execute the Dissolve tool
GP.Execute "Dissolve_management", parameters, Nothing

Exit Sub
'Show all application errors, and severe GeoProcessor messages
MsgBox "A Runtime Error Occured. Error Number: " & CStr(Err.Number) & _
vbCrLf & "Error Description: " & Err.Description & vbCrLf & vbCrLf & "GP Message: " & GP.GetMessages(2), vbExclamation + vbOKOnly
End Sub

Posted in ArcObjects with Visual Basic | Leave a comment

KML Network Link

Network Links are great ways to reference KML or KMZ files archive on a local or remote location. You can use the element to specify the location of the KML file. Within that element, you can define the refresh options for updating the file, based on time and camera change. NetworkLinks can be used in combination with Regions to handle very large datasets efficiently. Following is a code snippet in C# : –

public void AddSensorNetworkLink(XmlDocument doc, XmlNode DocumentNode, string sensor, string URL)
XmlNode NetworkLinkNode = doc.CreateElement("NetworkLink");
XmlNode nameNode = doc.CreateElement("name");

XmlNode LinkNode = doc.CreateElement("Link");
XmlNode hrefNode = doc.CreateElement("href");

Posted in ArcObjects with Visual C# .NET | Leave a comment

Create polygon in a KML file

The following C# code will help you in creating a polygon for Google Earth based KML file. Have a look: –

public void AddPolygon(XmlDocument doc, XmlNode DocumentNode, int lat, int lon, int gridsize, string name, string id)
XmlNode PlacemarkNode = doc.CreateElement("Placemark");
XmlNode nameNode = doc.CreateElement("name");
XmlNode StyleNode = doc.CreateElement("styleUrl");
XmlNode PolyNode = doc.CreateElement("Polygon");
XmlNode tessNode = doc.CreateElement("tessellate");
XmlNode altNode = doc.CreateElement("altitudeMode");
XmlNode BoundNode = doc.CreateElement("outerBoundaryIs");
XmlNode LineNode = doc.CreateElement("LinearRing");
XmlNode coordinateNode = doc.CreateElement("coordinates");

string coord = lon.ToString() + "," + lat.ToString() + ",0," + Convert.ToString(lon + gridsize) + "," + lat.ToString() + ",0," + Convert.ToString(lon + gridsize) + "," + Convert.ToString(lat + gridsize) + ",0," + lon.ToString() + "," + Convert.ToString(lat + gridsize) + ",0," + lon.ToString() + "," + lat.ToString()+ ",0";


Posted in ArcObjects with Visual C# .NET | Leave a comment


Arc Hydro has been designed to represent data from hydrography and hydrology, thereby creating a basis for obtaining a deeper understanding of surface water systems. The Arc Hydro tools are a set of utilities developed on top of the Arc Hydro data model. They operate in the ArcGIS environment. Some of the functions require the Spatial and 3D Analyst extensions. More on this in a technical paper presented on the occasion of Map India 2004: –

Posted in Technical Papers | Leave a comment

On becoming ESRI MVP

Thanks to all professional friends and colleagues for this.

Posted in General | Leave a comment