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);

  • 相关阅读:
    ORACLE NOLOGGING研究
    由2013星光大道总决赛同步程序猿怎样成功?
    configure: error: mysql configure failed. Please check config.log for more information.
    The 2014 ACM-ICPC Asia Mudanjiang Regional Contest(2014牡丹江区域赛)
    about service in android
    极客标签互动课程系列 - Javascript生成SVG动画素描特效
    sql -- 移除数据中的换行符和回车符
    前端project师必需知识点
    spring装配集合
    【java项目实践】具体解释Ajax工作原理以及实现异步验证username是否存在+源代码下载(java版)
  • 原文地址:https://www.cnblogs.com/cglNet/p/2391633.html
Copyright © 2011-2022 走看看