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

  • 相关阅读:
    AWR报告-数据库概要信息(一)
    性能tips
    linux脚本随笔-01
    小和问题 和逆序对问题
    SpringMVC 学习笔记(拦截器的配置))
    删除eclipse Maven 进程 导致eclipse的workspace 启动不了
    SpringMVC 学习笔记(请求方法的返回值和参数)
    SpringMVC 学习笔记(处理器映射器的配置)
    (转)Maven 项目新建index.jsp报错问题
    MyBatis 学习总结(1)
  • 原文地址:https://www.cnblogs.com/cglNet/p/2391633.html
Copyright © 2011-2022 走看看