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

  • 相关阅读:
    Pikachu漏洞平台---XSS(Cross-Site Scripting) 跨站脚本
    Pikachu漏洞练习平台(暴力破解模块)
    DVWA-- 不安全得验证码Insecure CAPTCHA
    DVWA-文件上传 File Upload
    DVWA之CSRF(跨站请求伪造)
    绑定方法与非绑定方法
    XML,面向对象基础
    configparser ,subprocess , xlrd ,xlwt 模块
    logging ,re 模块
    random,json,pickle,hashlib,shutil,hmac,shelve 模块
  • 原文地址:https://www.cnblogs.com/cglNet/p/2391633.html
Copyright © 2011-2022 走看看