how to convert from layer to kml (kmz) in arcgis engine 9.2 using c#?

1610
2
10-14-2011 06:17 AM
Highlighted
New Contributor
how to convert from layer to kml (kmz) in arcgis engine 9.2 using c#
hi for every one..
i'm sure i find the solution here.
i'm refered to use esri.arcgis.conversationTools nameSpace but , i didn't  see any class (such as Kml toLyer or toKml) that does the conversation.

information:
my map is .mxd
the language i used is c# 2005.

i search more in google but no results
please help me..

thanx in advanced...
Reply
0 Kudos
2 Replies
Highlighted
New Contributor
no any replies

i want only  the entry point to start
does arcgis engine 9.2 support the conversion using c#?

please i need the help
Reply
0 Kudos
Highlighted
New Contributor
i finally find the solution
i write the code to help anyone want do this conversion 

this is the code (using c#) to convert layer to KML:

//convert layer to kml
                ESRI.ArcGIS.Geoprocessor.Geoprocessor GP = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
                GP.AddToolbox(@"C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\3D Analyst Tools.tbx");

                GP.SetEnvironmentValue("workspace", @"C:\Maps\Maps");

                GP.OverwriteOutput = true;

                IVariantArray parameters = new VarArrayClass();
               // assign  parameters       
                parameters.Add(mylayer);
                parameters.Add(@"C:\Maps\Maps\city.kmz");
                parameters.Add(1);

                GP.Execute("LayerToKML_3D", parameters, null);
Reply
0 Kudos