📄 classogrlayer.html
字号:
<a class="anchor" name="75c06b4993f8eb76b569f37365cd19ab"></a><!-- doxytag: member="OGRLayer::GetSpatialRef" ref="75c06b4993f8eb76b569f37365cd19ab" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> * OGRLayer::GetSpatialRef </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline, virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch the spatial reference system for this layer.<p>The returned object is owned by the <a class="el" href="classOGRLayer.html">OGRLayer</a> and should not be modified or freed by the application.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#8b2a10085f410aa84172eba413408c39">OGR_L_GetSpatialRef()</a>.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>spatial reference, or NULL if there isn't one. </dd></dl></div></div><p><a class="anchor" name="74c796d4ce712e9a78df6042eeb8a91a"></a><!-- doxytag: member="OGRLayer::GetFeatureCount" ref="74c796d4ce712e9a78df6042eeb8a91a" args="(int bForce=TRUE)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRLayer::GetFeatureCount </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>bForce</em> = <code>TRUE</code> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch the feature count in this layer.<p>Returns the number of features in the layer. For dynamic databases the count may not be exact. If bForce is FALSE, and it would be expensive to establish the feature count a value of -1 may be returned indicating that the count isn't know. If bForce is TRUE some implementations will actually scan the entire layer once to count objects.<p>The returned count takes the spatial filter into account.<p>This method is the same as the C function OGR_L_GetFeatureCount().<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>bForce</em> </td><td>Flag indicating whether the count should be computed even if it is expensive.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>feature count, -1 if count not known. </dd></dl></div></div><p><a class="anchor" name="3be658ddb5b33d1ed95c31286774bbd2"></a><!-- doxytag: member="OGRLayer::GetExtent" ref="3be658ddb5b33d1ed95c31286774bbd2" args="(OGREnvelope *psExtent, int bForce=TRUE)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">OGRErr OGRLayer::GetExtent </td> <td>(</td> <td class="paramtype"><a class="el" href="classOGREnvelope.html">OGREnvelope</a> * </td> <td class="paramname"> <em>psExtent</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>bForce</em> = <code>TRUE</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch the extent of this layer.<p>Returns the extent (MBR) of the data in the layer. If bForce is FALSE, and it would be expensive to establish the extent then OGRERR_FAILURE will be returned indicating that the extent isn't know. If bForce is TRUE then some implementations will actually scan the entire layer once to compute the MBR of all the features in the layer.<p>The returned extent does not take the spatial filter into account. If a spatial filter was previously set then it should be ignored but some implementations may be unable to do that, so it is safer to call <a class="el" href="classOGRLayer.html#3be658ddb5b33d1ed95c31286774bbd2">GetExtent()</a> without setting a spatial filter.<p>Layers without any geometry may return OGRERR_FAILURE just indicating that no meaningful extents could be collected.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#a6c495581900c8301dff91d8cd3ee12f">OGR_L_GetExtent()</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>psExtent</em> </td><td>the structure in which the extent value will be returned. </td></tr> <tr><td valign="top"></td><td valign="top"><em>bForce</em> </td><td>Flag indicating whether the extent should be computed even if it is expensive.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>OGRERR_NONE on success, OGRERR_FAILURE if extent not known. </dd></dl></div></div><p><a class="anchor" name="eedbda1a62f9b89b8e5f24332cf22286"></a><!-- doxytag: member="OGRLayer::TestCapability" ref="eedbda1a62f9b89b8e5f24332cf22286" args="(const char *)=0" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRLayer::TestCapability </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszCap</em> </td> <td> ) </td> <td width="100%"><code> [pure virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Test if this layer supported the named capability.<p>The capability codes that can be tested are represented as strings, but defined constants exists to ensure correct spelling. Specific layer types may implement class specific capabilities, but this can't generally be discovered by the caller.<p><ul><li><b>OLCRandomRead</b> / "RandomRead": TRUE if the <a class="el" href="classOGRLayer.html#cb7625383f161e5a04aeea2173dce411">GetFeature()</a> method works for this layer.<p><p></li><li><b>OLCSequentialWrite</b> / "SequentialWrite": TRUE if the <a class="el" href="classOGRLayer.html#aa1e32016f481596a55e1d988a15a067">CreateFeature()</a> method works for this layer. Note this means that this particular layer is writable. The same <a class="el" href="classOGRLayer.html">OGRLayer</a> class may returned FALSE for other layer instances that are effectively read-only.<p><p></li><li><b>OLCRandomWrite</b> / "RandomWrite": TRUE if the <a class="el" href="classOGRLayer.html#681139bfd585b74d7218e51a32144283">SetFeature()</a> method is operational on this layer. Note this means that this particular layer is writable. The same <a class="el" href="classOGRLayer.html">OGRLayer</a> class may returned FALSE for other layer instances that are effectively read-only.<p><p></li><li><b>OLCFastSpatialFilter</b> / "FastSpatialFilter": TRUE if this layer implements spatial filtering efficiently. Layers that effectively read all features, and test them with the <a class="el" href="classOGRFeature.html">OGRFeature</a> intersection methods should return FALSE. This can be used as a clue by the application whether it should build and maintain it's own spatial index for features in this layer.<p><p></li><li><b>OLCFastFeatureCount</b> / "FastFeatureCount": TRUE if this layer can return a feature count (via <a class="el" href="classOGRLayer.html#74c796d4ce712e9a78df6042eeb8a91a">OGRLayer::GetFeatureCount()</a>) efficiently ... ie. without counting the features. In some cases this will return TRUE until a spatial filter is installed after which it will return FALSE.<p><p></li><li><b>OLCFastGetExtent</b> / "FastGetExtent": TRUE if this layer can return its data extent (via <a class="el" href="classOGRLayer.html#3be658ddb5b33d1ed95c31286774bbd2">OGRLayer::GetExtent()</a>) efficiently ... ie. without scanning all the features. In some cases this will return TRUE until a spatial filter is installed after which it will return FALSE.<p><p></li><li><b>OLCFastSetNextByIndex</b> / "FastSetNextByIndex": TRUE if this layer can perform the <a class="el" href="classOGRLayer.html#e3b6234d6077a18a19eddaf7e75ff5e1">SetNextByIndex()</a> call efficiently, otherwise FALSE.<p><p></li></ul><p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#480adc8b839b04597f49583371d366fd">OGR_L_TestCapability()</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>pszCap</em> </td><td>the name of the capability to test.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>TRUE if the layer has the requested capability, or FALSE otherwise. OGRLayers will return FALSE for any unrecognised capabilities.</dd></dl></div></div><p><a class="anchor" name="143b0d2c48bc0adf3a19d1f51e76b8ba"></a><!-- doxytag: member="OGRLayer::GetInfo" ref="143b0d2c48bc0adf3a19d1f51e76b8ba" args="(const char *)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * OGRLayer::GetInfo </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszTag</em> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Fetch metadata from layer.<p>This method can be used to fetch various kinds of metadata or layer specific information encoded as a string. It is anticipated that various tag values will be defined with well known semantics, while other tags will be used for driver/application specific purposes.<p>This method is deprecated and will be replaced with a more general metadata model in the future. At this time no drivers return information via the <a class="el" href="classOGRLayer.html#143b0d2c48bc0adf3a19d1f51e76b8ba">GetInfo()</a> call.<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>pszTag</em> </td><td>the tag for which information is being requested.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the value of the requested tag, or NULL if that tag does not have a value, or is unknown. </dd></dl></div></div><p><a class="anchor" name="00b1376a1eabb1298ef278f92f6d84be"></a><!-- doxytag: member="OGRLayer::CreateField" ref="00b1376a1eabb1298ef278f92f6d84be" args="(OGRFieldDefn *poField, int bApproxOK=TRUE)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">OGRErr OGRLayer::CreateField </td> <td>(</td> <td class="paramtype"><a class="el" href="classOGRFieldDefn.html">OGRFieldDefn</a> * </td> <td class="paramname"> <em>poField</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>bApproxOK</em> = <code>TRUE</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Create a new field on a layer. You must use this to create new fields on a real layer. Internally the <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a> for the layer will be updated to reflect the new field. Applications should never modify the <a class="el" href="classOGRFeatureDefn.html">OGRFeatureDefn</a> used by a layer directly.<p>This function is the same as the C function <a class="el" href="ogr__api_8h.html#ab585ef1166c61c4819f7fd46ee4a275">OGR_L_CreateField()</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>poField</em> </td><td>field definition to write to disk. </td></tr> <tr><td valign="top"></td><td valign="top"><em>bApproxOK</em> </td><td>If TRUE, the field may be created in a slightly different form depending on the limitations of the format driver.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>OGRERR_NONE on success. </dd></dl></div></div><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -