如何在mapinfo中绘制两点连线?
目前我有几百个两点需要连线,如何一对一对的连接是非常的麻烦,希望能有简便点的方法,高手帮助!!!(希望是能把点点关系列出来就能解决!)...
目前我有几百个两点需要连线,如何一对一对的连接是非常的麻烦,希望能有简便点的方法,高手帮助!!!(希望是能把点点关系列出来就能解决!)
展开
展开全部
我前两天写的程序,
不知道你有没有mapbasic.
还有你的文件结构是怎么样的,需要你详细说明一下。
源代码如下,自己参考一下。
include "mapbasic.def"
declare sub main
declare sub drawnetwork
sub main
call drawnetwork
end sub
sub drawnetwork
dim i_id, i_start,i_end as integer
dim f_sx, f_sy, f_ex, f_ey as float
fetch first from netexcel
do until eot(netexcel)
i_id = netexcel.id
i_start = netexcel.node1
i_end = netexcel.node2
select * from node where id = i_start into temp1
f_sx = centroidx(temp1.obj)
f_sy = centroidy(temp1.obj)
select * from node where id = i_end into temp2
f_ex = centroidx(temp2.obj)
f_ey = centroidy(temp2.obj)
insert into link (obj,id,node1,node2)
values (Createline(f_sx, f_sy,f_ex, f_ey),i_id,i_start,i_end)
fetch next from netexcel
loop
end sub
不知道你有没有mapbasic.
还有你的文件结构是怎么样的,需要你详细说明一下。
源代码如下,自己参考一下。
include "mapbasic.def"
declare sub main
declare sub drawnetwork
sub main
call drawnetwork
end sub
sub drawnetwork
dim i_id, i_start,i_end as integer
dim f_sx, f_sy, f_ex, f_ey as float
fetch first from netexcel
do until eot(netexcel)
i_id = netexcel.id
i_start = netexcel.node1
i_end = netexcel.node2
select * from node where id = i_start into temp1
f_sx = centroidx(temp1.obj)
f_sy = centroidy(temp1.obj)
select * from node where id = i_end into temp2
f_ex = centroidx(temp2.obj)
f_ey = centroidy(temp2.obj)
insert into link (obj,id,node1,node2)
values (Createline(f_sx, f_sy,f_ex, f_ey),i_id,i_start,i_end)
fetch next from netexcel
loop
end sub
上海华然企业咨询
2024-10-21 广告
2024-10-21 广告
上海华然企业咨询有限公司专注于AI与数据合规咨询服务。我们的核心团队来自头部互联网企业、红圈律所和专业安全服务机构。凭借深刻的AI产品理解、上百个AI产品的合规咨询和算法备案经验,为客户提供专业的算法备案、AI安全评估、数据出境等合规服务,...
点击进入详情页
本回答由上海华然企业咨询提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询