arcgis-ae+c#中返回距离函数报错

问题描述

ae+c#中返回距离函数报错

IFeatureLayer aFL = axMapControl1.Map.get_Layer(0) as IFeatureLayer;
IFeatureLayer bFL = axMapControl1.Map.get_Layer(1) as IFeatureLayer;
IFeatureClass aFClass = aFL.FeatureClass;
IFeatureCursor aFC = aFClass.Search(null, true);
IFeature aF = aFC.NextFeature();
int num = 0;
while (aF!= null)
{
if (Convert.ToInt32(aF.get_Value(aF.Fields.FindField("price"))) == 0)
{
textBox1.Text = "现在跑" + num + "个栅格";
textBox1.Refresh();
num++;
aF = aFC.NextFeature();
continue;
}
else
{
IFeatureClass bFClass = bFL.FeatureClass;
IQueryFilter bQF = new QueryFilterClass();
bQF.WhereClause = "类型 = " + "4";
IFeatureCursor bFC = bFClass.Search(bQF, true);
IFeature bF = bFC.NextFeature();
double minDist = 99999.9;
while (bF != null)
{
IIdentify aI = aFL as IIdentify;
IArray aA = aI.Identify(bF.Shape);
int idCount = 0;
double featureMinDist = 99999.9;
while (idCount < aA.Count)
{
IFeatureIdentifyObj aFIO = aA.get_Element(idCount) as IFeatureIdentifyObj;
IRowIdentifyObject aRIO = aFIO as IRowIdentifyObject;
IFeature aaF = aRIO.Row as IFeature;
IGeometry aG = aF.Shape as IGeometry;
IProximityOperator aPO = aG as IProximityOperator;
double dist = aPO.ReturnDistance(aaF.Shape as IGeometry);
if (dist < featureMinDist)
{
featureMinDist = dist;
}
idCount++;
}
if (featureMinDist < minDist)
{
minDist = featureMinDist;
}
bF = bFC.NextFeature();

                }
                aF.set_Value(aF.Fields.FindField("ggdist"), minDist);
                aF.Store();
                aF = aFC.NextFeature();
                textBox1.Text = "现在跑" + num + "个栅格";
                textBox1.Refresh();
                num++;
            }
        }
                    错误图为![图片说明](http://img.ask.csdn.net/upload/201503/19/1426740041_962748.png)
                    请教哪里出问题了 而且为什么报错的时候dist值为0呢
时间: 2024-09-17 04:38:39

arcgis-ae+c#中返回距离函数报错的相关文章

c语言-把数组中的元素 循环的作为函数中的参数 报错!

问题描述 把数组中的元素 循环的作为函数中的参数 报错! 把数组中的元素 循环的作为函数中的参数 怎么会报错 麻烦前辈帮忙看看 #include<stdio.h>int ShowNumber();int main (){ int number[10]; int i ; //循环变量 //随便为number数组赋值 for(i=0;i<10;i++)// i=0 1 2 3 4 5 6 7 8 9 { number[i]=i; } for(i=0;i<10;i++) { ShowNu

sqlite-安卓中使用SQlite报错

问题描述 安卓中使用SQlite报错 创建一个数据库,根据返回值设置textView值.然后报错:"SYNTAX ERROR(code1) " 代码: package com.example.dbex; import java.sql.SQLOutput; import java.sql.SQLPermission; import android.content.ContentValues; import android.content.Context; import android.

android中sqlite一直报错

问题描述 android中sqlite一直报错 在应用中用到sqlite,创建了一些表,代码如下: db.execSQL("CREATE TABLE IF NOT EXISTS " + GAMES_HISTORY_TABLE+ " (" + GAME_KEY + " INTEGER PRIMARY KEY AUTOINCREMENT, " + RIGHT_DRILLS + "INTEGER NOT NULL, " + NUM_

android中应用编译报错

问题描述 android中应用编译报错 一个带下拉列表的应用,在编译的时候报错: The constructor ArrayAdapter(LayoutNext, int, String[]) is undefined 不知道应该怎么解决? 我的实现代码: public class LayoutNext extends Fragment implements OnClickListener,OnItemSelectedListener{ TimePicker timepicker; privat

post请求-Post请求方式在地址栏中敲回车报错

问题描述 Post请求方式在地址栏中敲回车报错 Spring mvc中表单以post方式提交后将数据带到新的页面,但是在浏览器地址栏中敲回车的时候报错,地址栏回车属于get方式,请问这种情况如何避 解决方案 不指定请求访问方式不就可以了么 解决方案二: post 方式,不是get,给你个post工具 谷歌浏览器一样post测试 postman 解决方案三: post方式只能设计一个表单,一个提交按钮,才可以.浏览器输入地址,是get 解决方案四: 不知道题主的困惑在哪个地方,是想要调试post的

myeclipse中启动tomcat报错

问题描述 myeclipse中启动tomcat报错 在myeclipse中启动tomcat时报错,不知道怎么解决,请网友指点:报错信息如下Deployment is out of date due to changes in the underlying project contents.You'll need to 'Redeploy' the project to update the deployed archive; 警告提示是:构建路径指定执行环境 JavaSE-1.6.工作空间中没有

select-存储过程中SELECT赋值报错什么原因?

问题描述 存储过程中SELECT赋值报错什么原因? CREATE OR REPLACE PROCEDURE PROC_DICTABLE_TBYSFL(p_ANetUser VARCHAR)ISvc_DICTABLEID varchar2(36);vc_DICTABLECOLID varchar2(36);vc_DICCOL1 VARCHAR2(20);vc_DICCOL2 VARCHAR2(20);vc_DICCOL3 VARCHAR2(20);vc_DICCOL4 VARCHAR2(20);v

ndk ndroid tudio jni-AndroidStudio中开发ndk报错,求助!!!

问题描述 AndroidStudio中开发ndk报错,求助!!! D:workspacesAndroidProjectsGISpeechappsrcmainjniHTKLibexcpt.h:20:21: fatal error: crtdefs.h: No such file or directory #include <crtdefs.h> as 的项目中使用ndk 开发,其中有些 c 文件中引用了一些 系统平台下的 h 文件,在 vs2010 中可以调通,但是加入到 jni 中就报错,请问

c c++-析构函数中使用delete报错

问题描述 析构函数中使用delete报错 把析构函数里的delete去掉就不会报错了:但是搞不懂:我的构造函数里不是用了new吗,为什么会出现这种情况? 报错信息是:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse),网上查了一下都说是重发调用delete的结果,但是我好像没有那么做. //Matrix.h class Matrix { public: Matrix(); ~Matrix(); Matrix(int,double*); //矩阵行列数.数组指针 Matr