📄 classogrfeature.html
字号:
<p>Take away ownership of geometry.<p>Fetch the geometry from this feature, and clear the reference to the geometry on the feature. This is a mechanism for the application to take over ownship of the geometry from the feature without copying. Sort of an inverse to <a class="el" href="classOGRFeature.html#40a4ddb33f09a5f340b9139be72e277d">SetGeometryDirectly()</a>.<p>After this call the <a class="el" href="classOGRFeature.html">OGRFeature</a> will have a NULL geometry.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the pointer to the geometry. </dd></dl></div></div><p><a class="anchor" name="580a742ae4952c3a4a0dd25ae2afb7e5"></a><!-- doxytag: member="OGRFeature::Clone" ref="580a742ae4952c3a4a0dd25ae2afb7e5" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRFeature.html">OGRFeature</a> * OGRFeature::Clone </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Duplicate feature.<p>The newly created feature is owned by the caller, and will have it's own reference to the <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a>.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#90c0adfd518b71571d9ce8d976fab320">OGR_F_Clone()</a>.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>new feature, exactly matching this feature. </dd></dl></div></div><p><a class="anchor" name="738dfd54ecb6fb86e294929e91f90479"></a><!-- doxytag: member="OGRFeature::Equal" ref="738dfd54ecb6fb86e294929e91f90479" args="(OGRFeature *poFeature)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">OGRBoolean OGRFeature::Equal </td> <td>(</td> <td class="paramtype"><a class="el" href="classOGRFeature.html">OGRFeature</a> * </td> <td class="paramname"> <em>poFeature</em> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Test if two features are the same.<p>Two features are considered equal if the share them (pointer equality) same <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a>, have the same field values, and the same geometry (as tested by OGRGeometry::Equal()) as well as the same feature id.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#8b6a502ec0b70f3de50e7184a087a264">OGR_F_Equal()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>poFeature</em> </td><td>the other feature to test this one against.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>TRUE if they are equal, otherwise FALSE. </dd></dl></div></div><p><a class="anchor" name="b7f4eb0c098a9456d4005828127cdde0"></a><!-- doxytag: member="OGRFeature::GetFieldCount" ref="b7f4eb0c098a9456d4005828127cdde0" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRFeature::GetFieldCount </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch number of fields on this feature. This will always be the same as the field count for the <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a>.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#f6c1440956ee56c0c160394bccf96990">OGR_F_GetFieldCount()</a>.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>count of fields. </dd></dl></div></div><p><a class="anchor" name="35aba5a674e9901eccf1e7d90d97d773"></a><!-- doxytag: member="OGRFeature::GetFieldDefnRef" ref="35aba5a674e9901eccf1e7d90d97d773" args="(int iField)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRFieldDefn.html">OGRFieldDefn</a> * OGRFeature::GetFieldDefnRef </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iField</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch definition for this field.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#6f8fc7fd6ecca789ad90db6d28391623">OGR_F_GetFieldDefnRef()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iField</em> </td><td>the field to fetch, from 0 to <a class="el" href="classOGRFeature.html#b7f4eb0c098a9456d4005828127cdde0">GetFieldCount()</a>-1.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the field definition (from the <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a>). This is an internal reference, and should not be deleted or modified. </dd></dl></div></div><p><a class="anchor" name="b49421f777e56b7cb41169f1301a7b21"></a><!-- doxytag: member="OGRFeature::GetFieldIndex" ref="b49421f777e56b7cb41169f1301a7b21" args="(const char *pszName)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRFeature::GetFieldIndex </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszName</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch the field index given field name.<p>This is a cover for the <a class="el" href="classOGRFeatureDefn.html#4f7111e4c818f194932795e9c9593258">OGRFeatureDefn::GetFieldIndex()</a> method.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#9a8a6b93ab97204b94f5c2b358f8f98e">OGR_F_GetFieldIndex()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pszName</em> </td><td>the name of the field to search for.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the field index, or -1 if no matching field is found. </dd></dl></div></div><p><a class="anchor" name="937b21e0137e40bc1473f354879975da"></a><!-- doxytag: member="OGRFeature::UnsetField" ref="937b21e0137e40bc1473f354879975da" args="(int iField)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void OGRFeature::UnsetField </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iField</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Clear a field, marking it as unset.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#a70b7675a003141e63f9603c752ee22e">OGR_F_UnsetField()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iField</em> </td><td>the field to unset. </td></tr> </table></dl></div></div><p><a class="anchor" name="e7f676d5a8e1f62d80b438c13b159ee0"></a><!-- doxytag: member="OGRFeature::GetRawFieldRef" ref="e7f676d5a8e1f62d80b438c13b159ee0" args="(int i)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="unionOGRField.html">OGRField</a> * OGRFeature::GetRawFieldRef </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iField</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch a pointer to the internal field value given the index.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#f7043e9dfadbdeca8059ace336875d4c">OGR_F_GetRawFieldRef()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iField</em> </td><td>the field to fetch, from 0 to <a class="el" href="classOGRFeature.html#b7f4eb0c098a9456d4005828127cdde0">GetFieldCount()</a>-1.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the returned pointer is to an internal data structure, and should not be freed, or modified. </dd></dl></div></div><p><a class="anchor" name="dd319b68ea27a4ee0602d3aa460ca3b5"></a><!-- doxytag: member="OGRFeature::GetFieldAsInteger" ref="dd319b68ea27a4ee0602d3aa460ca3b5" args="(int i)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRFeature::GetFieldAsInteger </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iField</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Fetch field value as integer.<p>OFTString features will be translated using atoi(). OFTReal fields will be cast to integer. Other field types, or errors will result in a return value of zero.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#cfb4d2c0001af379e396021ecbdaf275">OGR_F_GetFieldAsInteger()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iField</em> </td><td>the field to fetch, from 0 to <a class="el" href="classOGRFeature.html#b7f4eb0c098a9456d4005828127cdde0">GetFieldCount()</a>-1.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the field value. </dd></dl></div></div><p><a class="anchor" name="b8a57c94e8bb8ffac5e7048d896254b4"></a><!-- doxytag: member="OGRFeature::GetFieldAsDouble" ref="b8a57c94e8bb8ffac5e7048d896254b4" args="(int i)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">double OGRFeature::GetFieldAsDouble </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iField</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Fetch field value as a double.<p>OFTString features will be translated using atof(). OFTInteger fields will be cast to double. Other field types, or errors will result in a return value of zero.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#62252a0d4538c695d41956a96cdc6978">OGR_F_GetFieldAsDouble()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iField</em> </td><td>the field to fetch, from 0 to <a class="el" href="classOGRFeature.html#b7f4eb0c098a9456d4005828127cdde0">GetFieldCount()</a>-1.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the field value. </dd></dl></div></div><p><a class="anchor" name="c7a0224e13dce1f9479a6bf2111ea766"></a><!-- doxytag: member="OGRFeature::GetFieldAsString" ref="c7a0224e13dce1f9479a6bf2111ea766" args="(int i)" --><div class="memitem"><div class="memproto"> <table class="memname">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -