P
pandame
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TmainForm.Button3Click(Sender: TObject);
var
i,j,num:integer;
cposoints;
//道路交叉点crosspoints
ftr:feature;
log:Boolean;
begin
num:=map1.layers.Item['roads'].Allfeatures.count;
for i:=1 to numdo
begin
for j:=2 to num-1do
begin
if i=j then
continue;
log:= map1.FeatureFactory.IntersectionTest(map1.layers.Item['roads'].GetFeatureByID(i),map1.layers.Item['roads'].GetFeatureByID(j),1);
//判断有交点否
if log then
begin
ftr:=map1.FeatureFactory.Intersectfeatures(map1.layers.Item['roads'].GetFeatureByID(i),map1.layers.Item['roads'].GetFeatureByID(j));
map1.FeatureFactory.EraseFeature(map1.layers.Item['roads'].GetFeatureByID(i),ftr);
//用重叠部分对两道路进行擦除
map1.FeatureFactory.EraseFeature(map1.layers.Item['roads'].GetFeatureByID(j),ftr);
//用重叠部分对两道路进行擦除
end;
end;
end;
end;
编译可以通过,但运行时报错:project dl.exe raise exception class EOleException witn message'Error combining Feature'.process stopped. 兰条停在有Intersectfeatures的那一行,不知道什么原因,还请大虾们指点!
var
i,j,num:integer;
cposoints;
//道路交叉点crosspoints
ftr:feature;
log:Boolean;
begin
num:=map1.layers.Item['roads'].Allfeatures.count;
for i:=1 to numdo
begin
for j:=2 to num-1do
begin
if i=j then
continue;
log:= map1.FeatureFactory.IntersectionTest(map1.layers.Item['roads'].GetFeatureByID(i),map1.layers.Item['roads'].GetFeatureByID(j),1);
//判断有交点否
if log then
begin
ftr:=map1.FeatureFactory.Intersectfeatures(map1.layers.Item['roads'].GetFeatureByID(i),map1.layers.Item['roads'].GetFeatureByID(j));
map1.FeatureFactory.EraseFeature(map1.layers.Item['roads'].GetFeatureByID(i),ftr);
//用重叠部分对两道路进行擦除
map1.FeatureFactory.EraseFeature(map1.layers.Item['roads'].GetFeatureByID(j),ftr);
//用重叠部分对两道路进行擦除
end;
end;
end;
end;
编译可以通过,但运行时报错:project dl.exe raise exception class EOleException witn message'Error combining Feature'.process stopped. 兰条停在有Intersectfeatures的那一行,不知道什么原因,还请大虾们指点!