当前位置: 首页>>代码示例>>C#>>正文


C# Geoprocessor.GetMessage方法代码示例

本文整理汇总了C#中Geoprocessor.GetMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Geoprocessor.GetMessage方法的具体用法?C# Geoprocessor.GetMessage怎么用?C# Geoprocessor.GetMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Geoprocessor的用法示例。


在下文中一共展示了Geoprocessor.GetMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FieldCal

        //执行计算,输出计算结果信息字符串
        private string FieldCal(IFeatureLayer pFtLayer, string strExpression)
        {
            txtMessage.Text = "正在计算请稍后……\r\n";
            try
            {
                Geoprocessor Gp = new Geoprocessor();
                Gp.OverwriteOutput = true;
                CalculateField calField = new CalculateField();
                
                calField.expression = strExpression;

                Gp.Execute(calField, null);

                for (int i = 0; i < Gp.MessageCount; i++)
                {
                    txtMessage.Text += Gp.GetMessage(i).ToString() + "\r\n";
                }
                return "计算成功";
            }
            catch (Exception e)
            {
                txtMessage.Text += e.Message;
                return "计算失败" + e.Message;
            }
        }
开发者ID:Kingvey,项目名称:ConstructionLandEvaluationSystem,代码行数:26,代码来源:FormAttributeSelection.cs

示例2: ReturnMessages

 protected virtual void ReturnMessages(Geoprocessor gp)
 {
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             Console.WriteLine(gp.GetMessage(Count));
         }
     }
 }
开发者ID:truonghinh,项目名称:TnX,代码行数:10,代码来源:GeoprocessorAbstract.cs

示例3: GetMessages2

 /// <summary>
 /// 输出地理处理的过程信息
 /// </summary>
 /// <param name="gp"></param>
 /// <returns></returns>
 public static string GetMessages2(Geoprocessor gp)
 {
     StringBuilder msgBuilder = new StringBuilder();
     if (gp != null)
     {
         for (int i = 0; i < gp.MessageCount; i++)
         {
             msgBuilder.Append(gp.GetMessage(i));
             msgBuilder.Append(" ");
         }
     }
     return msgBuilder.ToString();
 }
开发者ID:Joe-xXx,项目名称:BatchGISTools,代码行数:18,代码来源:SpatialAnalysisHelper.cs

示例4: ReturnMessages

 //GP message handling
 private static void ReturnMessages(Geoprocessor gp)
 {
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             System.Console.WriteLine(gp.GetMessage(Count));
         }
     }
 }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:11,代码来源:CreateRasterMosaic.cs

示例5: ReturnMessages

 // Function for returning the tool messages.
 private static void ReturnMessages(Geoprocessor gp)
 {
     string ms = "";
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             ms += gp.GetMessage(Count);
         }
     }
 }
开发者ID:lovelll,项目名称:KMLToSHPBatch,代码行数:12,代码来源:SpatialDBManage.cs

示例6: ReturnMessages

 // Function for returning the tool messages.
 private static bool ReturnMessages(Geoprocessor gp)
 {
     bool theReturn = true;
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             string msg = gp.GetMessage(Count);
             if (msg.Contains("Failed to execute"))
                 theReturn = false;
             Debug.WriteLine(msg);
         }
     }
     return theReturn;
 }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:16,代码来源:ProjectTransactionCmd.cs

示例7: ExportPages


//.........这里部分代码省略.........

                //worldfile扩展名
                string worldfileExt = "." + sExt[1].ToString() + sExt[sExt.Length - 1].ToString() + "w";
                #endregion

                #region 分页输出
                int index = 0;
                int minX = 0, maxY = iHeight;
                double w, h = 0;
                string t_name = subPath + @"\" + NameNoExt + "_";
                IExport docExport = CreateExport(filename, 1);
                IEnvelope pEnv1 = new EnvelopeClass();
                while (h < height - 0.0001)
                {
                    w = 0;
                    minX = 0;
                    while (w < width - 0.0001)
                    {
                        pEnv1.XMin = w;
                        pEnv1.YMin = h;
                        pEnv1.XMax = w + paperWidth;
                        pEnv1.YMax = h + paperHeight;
                        index++;

                        label1.Text += ".";
                        Application.DoEvents();

                        //output输出
                        ActiveViewOutput(docActiveView, iDPI, iWidth, iHeight, pEnv1, t_name + index.ToString() + sExt, docExport);
                        //写入worldfile
                        WriteWorldfile(t_name + index.ToString() + worldfileExt, 1, 0, 0, -1, minX, maxY);
                        w += paperWidth;
                        minX += iWidth;
                    }
                    h += paperHeight;
                    maxY += iHeight;
                }
                #endregion

                #region 合并栅格
                //设置坐标参考
                var pRasterWS = OpenWorkspace(subPath, enumWsFactoryType.Raster);
                ISpatialReferenceFactory2 pSrF = new SpatialReferenceEnvironmentClass();
                var pSR = pSrF.CreateSpatialReference(3857);
                var pEnumDS = pRasterWS.get_Datasets(esriDatasetType.esriDTRasterDataset);
                var pDS = pEnumDS.Next();
                while (pDS != null)
                {
                    var GeoSchEdit = pDS as IGeoDatasetSchemaEdit;
                    if (GeoSchEdit.CanAlterSpatialReference)
                        GeoSchEdit.AlterSpatialReference(pSR);
                    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pDS);
                    pDS = pEnumDS.Next();
                }
                System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pRasterWS);

                //saveas时占用很大内存且不释放,使用GP工具
                //怎么不创建金字塔和头文件??
                Geoprocessor geoprocessor = new Geoprocessor();
                try
                {
                    CreateRasterDataset createRD = new CreateRasterDataset();
                    createRD.cellsize = 1;
                    createRD.number_of_bands = 3;
                    createRD.out_path = filepath;
                    createRD.out_name = NameExt;
                    createRD.pyramids = "NONE";
                    createRD.compression = "NONE";
                    geoprocessor.Execute(createRD, null);

                    WorkspaceToRasterDataset MosaicToRaster = new WorkspaceToRasterDataset();
                    MosaicToRaster.in_workspace = subPath;
                    MosaicToRaster.in_raster_dataset = filename;
                    geoprocessor.Execute(MosaicToRaster, null);
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                    for (int i = 0; i < geoprocessor.MessageCount; i++)
                    {
                        string abc = geoprocessor.GetMessage(i);
                        Console.WriteLine(abc);
                    }

                }
                #endregion

                return subPath;
            }
            else
            {
                Export10Plus(docActiveView, filename, iDPI, 0, 0, null);
                return "";
            }
            }
            else      //map
            {
            return "";
            }
        }
开发者ID:esrichina,项目名称:esrichinadevsummit2013-agsnet-MapExporter,代码行数:101,代码来源:FormExport.cs

示例8: CriarShapefile

        /// <summary>
        /// Cria um shapefile a partir de um featureCursor
        /// </summary>
        /// <param name="feature">Feature desejada</param>
        public static void CriarShapefile(IFeatureLayer fLayer,
                                        IFeature feature,
                                        string pasta,
                                        IActiveView activeView,
                                        bool adicionarSaidaNoMapa,
                                        IFeatureWorkspace pFeatureWorkspaceShp)
        {
            if (feature != null)
            {
                #region Deletando shapefiles que possam existir já no diretório
                DirectoryInfo dirInf = new DirectoryInfo(pasta);
                FileInfo[] fi = dirInf.GetFiles();
                for (int i = 0; i < fi.Length; i++)
                {
                    if (fi[i].Name.Contains(fLayer.FeatureClass.AliasName) && !fi[i].Name.Contains(".lock"))
                    {
                        fi[i].Delete();
                    }
                }
                #endregion

                IWorkspace pScratchWorkspace;
                IScratchWorkspaceFactory pScratchWorkspaceFactory;
                pScratchWorkspaceFactory = new ScratchWorkspaceFactoryClass();
                pScratchWorkspace = pScratchWorkspaceFactory.DefaultScratchWorkspace;
                IFeatureSelection pNewSelSet = fLayer as IFeatureSelection;
                IEnvelope pEnv = activeView.Extent.Envelope;
                IGeometry pEnvGeo = pEnv as IEnvelope;
                ISpatialFilter pSF = new SpatialFilterClass();
                pSF.Geometry = pEnvGeo;
                pSF.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

                IQueryFilter qf = new QueryFilterClass();

                qf.WhereClause = (fLayer as IFeatureLayerDefinition).DefinitionExpression;
                pNewSelSet.SelectFeatures(qf, esriSelectionResultEnum.esriSelectionResultNew, false);

                Geoprocessor gp = new Geoprocessor();
                gp.AddOutputsToMap = adicionarSaidaNoMapa;

                FeatureClassToShapefile fcToShapeFile = new FeatureClassToShapefile();

                fcToShapeFile.Input_Features = fLayer;
                fcToShapeFile.Output_Folder = pasta;

                IGeoProcessorResult result = gp.Execute(fcToShapeFile, null) as IGeoProcessorResult;
                string nomeArquivoSaida = gp.GetMessage(3);

                IFeatureClass pFeatureClassShp = pFeatureWorkspaceShp.OpenFeatureClass(fLayer.FeatureClass.AliasName);

                GisUtils.TratarSubtiposDominiosShapefile(fLayer, pasta, pFeatureWorkspaceShp, pFeatureClassShp);

                pFeatureClassShp = null;
                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
        }
开发者ID:ezequias,项目名称:Esri,代码行数:61,代码来源:GisUtils.cs

示例9: ReturnMessages

 private string ReturnMessages(Geoprocessor gp)
 {
     StringBuilder sb = new StringBuilder();
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             System.Diagnostics.Trace.WriteLine(gp.GetMessage(Count));
             sb.AppendFormat("{0}\n", gp.GetMessage(Count));
         }
     }
     return sb.ToString();
 }
开发者ID:Krystal001025,项目名称:temp,代码行数:13,代码来源:BufferDlg.cs

示例10: ReturnMessages

 private static string ReturnMessages(Geoprocessor gp)
 {
     string msgRet = "";
     if (gp.MessageCount > 0)
     {
         for (int Count = 0; Count <= gp.MessageCount - 1; Count++)
         {
             msgRet += gp.GetMessage(Count);
         }
     }
     return msgRet;
 }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:12,代码来源:DrawContours.cs


注:本文中的Geoprocessor.GetMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。