ArcGis 计算线段长度

时间:2023-03-08 16:32:51
        void CalcLength(string tmpshp)
        {
            var expression = "float(!SHAPE.LENGTH@YARDS!)";
            CalculateField cgridX = new CalculateField(tmpshp, "Length", expression);
            cgridX.expression_type = "PYTHON";
            IGeoProcessorResult gpResX = gp.Execute(cgridX, null) as IGeoProcessorResult;
            Console.WriteLine("计算长度");
        }  var gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();            gp.AddOutputsToMap = true;            gp.OverwriteOutput = true;            gp.TemporaryMapLayers = true;