zoukankan      html  css  js  c++  java
  • ShapeLib插入要素,效率远远高于ArcEngine的插入要素

                  string str =_Path+"\\"+ _Name;

                string str =_Path+"\\"+ _Name;

                IntPtr tShapePtr = ShapeLib.SHPOpen(str+".shp","rb+");

                //其中 "rb+"代表可读 可写。

                IntPtr tDBFPtr = ShapeLib.DBFOpen((str) + ".dbf","rb+");

                int iShape = 0;

                for (int i = 0; i < _Rows; i++)

                    {

                        for (int j = 0; j < _Cols; j++)

                        {

                            double[] pX=null;

                            double[] pY=null;

                            getPolygon(i,j,ref pX,ref pY);

                            IntPtr tPolygon = ShapeLib.SHPCreateSimpleObject(ShapeLib.ShapeType.Polygon, pX.Length, pX, pY, null);

                            if (tPolygon!=IntPtr.Zero)

                            {

                                ShapeLib.SHPWriteObject(tShapePtr, iShape, tPolygon);

                                ShapeLib.DBFWriteIntegerAttribute(tDBFPtr, iShape, 0, iShape);

                                ShapeLib.SHPDestroyObject(tPolygon);

                            }

                            iShape++;

                        }

                    }

                ShapeLib.SHPClose(tShapePtr);

                ShapeLib.DBFClose(tDBFPtr);

  • 相关阅读:
    『转』VC 工具使用和调试方法
    『轉』WINCE下如何实现发短信
    『转』Fatal error: Call to undefined function curl_init
    『转』WinCE驱动程序的分类
    『轉』Windows CE下的串口通讯类
    『轉』VC 6.0 “fatal error LNK1104: cannot open file "mfc42u.lib"”问题解决
    水晶报表乱码中文乱码问题(收藏)
    水晶报表如何完美导出一个Excel表格(收藏)
    ASP.NET AJAX(开发代号Atlas)重要参考资源大收集
    表格排序
  • 原文地址:https://www.cnblogs.com/cglNet/p/2391633.html
Copyright © 2011-2022 走看看