mapgis6.7二次开发vc6_demo 之五(输出VCT函数之面图层)

mapgis6.7二次开发vc6_demo 之五(输出VCT函数之面图层)

// // //输出vct面坐标 version=1, topo=0 //vp:hsg //create date:2012-04-20 // // #include "stdafx.h" #include "resource.h" #include <math.h> #include "win_area.h" #include "win_oper.h" #include "map_out.h" #include "demo.h" //------------------------------------------------------- extern char* AppTitle; //应用程序名称 extern AREA_HINST AHInst; extern HWND MainWnd; //主窗口句柄 extern HWND GrpWnd; //图形窗口句柄 //------------------------------------------------------- //------------------------------------------------------------ //define function style OutVctPloygonBeginEnd.cpp /* bool OutVctPloygonBeginEnd(short *ptALst); //输出vct面坐标 */ //------------------------------------------------------------ //实现 输出VCT面几何图形功能 OK bool OutVctPloygonBeginEnd(short *ptALst) { bool rbc = false; char* GeoVctType; char* FeatClassName; char* FeatureCode; char* FeatureName; short ai; //输出面坐标 long i,ln; long len; double x,y; char* tmp; char* Lfilename; short LayerType; //ShowMsg(this, "正在输出面坐标信息"); //输出面坐标 f_WriteLine("PolygonBegin"); for(int k=1;k<=ptALst[0];k++) { //获取一个工作区 ai=ptALst[k]; //获取图层类型 LayerType=_GetAreaType(ptALst[k]); if(LayerType==REG) { //输出vct面要素几何图形 //获取面层图元总个数 _GetRegNum(ai,&i,&ln); //获取工作区文件名 Lfilename=_GetAreaFileName(ai); //获取图层类型 GeoVctType=GetGeoVctType(ai); // FeatClassName =getfilenameNoExt_lc(Lfilename,"\\");; FeatureCode =FeatClassName;//a3u(GeoVctType,"_",i2cp(1)); FeatureName =FeatClassName;//FeatureCode; // D_DOT *pRegDot=NULL; long lRegDotNum=0; REG_INFO inf; long *rdat; double centerX = 0, centerY = 0; long lineNum = 0; for(i=1;i<ln;i++) //线要素总个数 { //short WINAPI _GetReg(short ai,long ri,long **rdat,long *len,REG_INFO *inf); if(_GetReg(ai,i,&rdat,&len,&inf)<=0) { continue; } lineNum += 1; f_WriteLine(l2cp(lineNum)); //第一行序号(目标标识码) f_WriteLine(FeatureCode); //第二行要素代码 f_WriteLine(FeatureName); //第三行要素名称 centerX = 0; centerY = 0; f_WriteLine(a3u(d2cp(centerX) , "," , d2cp(centerY))); //第四行几何中心点坐标(标识点坐标) //short WINAPI _GetLin(short ai,long li,D_DOT **dat,long *len,LIN_INFO *inf,short *dim=NULL); _GetLin(ai,rdat[1], &pRegDot,&lRegDotNum, NULL); //获取面中环 f_WriteLine(l2cp(lRegDotNum)); //第五行点数 for (k = 0; k<lRegDotNum; k++) { x=pRegDot[k].x; y=pRegDot[k].y; //写入到文本中 char* x_s=d2cp(x); char* y_s=d2cp(y); tmp=a2u(x_s,","); tmp=a2u(tmp,y_s); // f_WriteLine(tmp); //第六行点坐标 } f_WriteLine("0"); //最后用一个独占一行的0(点数为0)表示此面状要素数据的结束 if (lineNum % 100 == 0) { f_FlushFile(); } }//end while }//end reg } f_WriteLine("PolygonEnd"); f_WriteLine(""); f_FlushFile(); //ShowMsg(this, "完成输出面坐标信息"); rbc = true; return rbc; }
--the--end--

转载于:https://www.cnblogs.com/sqlite3/archive/2012/04/20/2566712.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值