首页 > 其他 > 详细

OGRFeature的DestroyFeature方法

时间:2014-07-31 13:13:46      阅读:628      评论:0      收藏:0      [点我收藏+]

 Ogr的销毁DestroyFeature方法:

1 void OGRFeature::DestroyFeature( OGRFeature *poFeature )
2 {
3     delete poFeature;
4 }

析构函数中删除了几何对象和空间参考定义, ogrfeature.cpp文件中查看:

bubuko.com,布布扣
 1 OGRFeature::~OGRFeature()
 2 
 3 {
 4     if( poGeometry != NULL )
 5         delete poGeometry;
 6 
 7     for( int i = 0; i < poDefn->GetFieldCount(); i++ )
 8     {
 9         OGRFieldDefn    *poFDefn = poDefn->GetFieldDefn(i);
10         
11         if( !IsFieldSet(i) )
12             continue;
13     
14         switch( poFDefn->GetType() )
15         {
16           case OFTString:
17             if( pauFields[i].String != NULL )
18                 VSIFree( pauFields[i].String );
19             break;
20 
21           case OFTBinary:
22             if( pauFields[i].Binary.paData != NULL )
23                 VSIFree( pauFields[i].Binary.paData );
24             break;
25 
26           case OFTStringList:
27             CSLDestroy( pauFields[i].StringList.paList );
28             break;
29 
30           case OFTIntegerList:
31           case OFTRealList:
32             CPLFree( pauFields[i].IntegerList.paList );
33             break;
34 
35           default:
36             // should add support for wide strings.
37             break;
38         }
39     }
40     
41     poDefn->Release();
42 
43     CPLFree( pauFields );
44     CPLFree(m_pszStyleString);
45     CPLFree(m_pszTmpFieldValue);
46 }
~OGRFeature()

 

OGRFeature的DestroyFeature方法,布布扣,bubuko.com

OGRFeature的DestroyFeature方法

原文:http://www.cnblogs.com/yhlx125/p/3880492.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!