📄 classogrdatasource.html
字号:
Execute an SQL statement against the data store.<p>The result of an SQL query is either NULL for statements that are in error, or that have no results set, or an <a class="el" href="classOGRLayer.html">OGRLayer</a> pointer representing a results set from the query. Note that this <a class="el" href="classOGRLayer.html">OGRLayer</a> is in addition to the layers in the data store and must be destroyed with OGRDataSource::ReleaseResultsSet() before the data source is closed (destroyed).<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#9892ecb0bf61add295bd9decdb13797a">OGR_DS_ExecuteSQL()</a>.<p>For more information on the SQL dialect supported internally by OGR review the <a href="ogr_sql.html">OGR SQL</a> document. Some drivers (ie. Oracle and PostGIS) pass the SQL directly through to the underlying RDBMS.<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>pszStatement</em> </td><td>the SQL statement to execute. </td></tr> <tr><td valign="top"></td><td valign="top"><em>poSpatialFilter</em> </td><td>geometry which represents a spatial filter. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pszDialect</em> </td><td>allows control of the statement dialect. By default it is assumed to be "generic" SQL, whatever that is.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>an <a class="el" href="classOGRLayer.html">OGRLayer</a> containing the results of the query. Deallocate with ReleaseResultsSet(). </dd></dl></div></div><p><a class="anchor" name="7d3ee7601f510a87afc76de8a51aa9b1"></a><!-- doxytag: member="OGRDataSource::ReleaseResultSet" ref="7d3ee7601f510a87afc76de8a51aa9b1" args="(OGRLayer *poResultsSet)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void OGRDataSource::ReleaseResultSet </td> <td>(</td> <td class="paramtype"><a class="el" href="classOGRLayer.html">OGRLayer</a> * </td> <td class="paramname"> <em>poResultsSet</em> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Release results of <a class="el" href="classOGRDataSource.html#a6acc228db6513784a56ce12334a8c33">ExecuteSQL()</a>.<p>This method should only be used to deallocate OGRLayers resulting from an <a class="el" href="classOGRDataSource.html#a6acc228db6513784a56ce12334a8c33">ExecuteSQL()</a> call on the same <a class="el" href="classOGRDataSource.html">OGRDataSource</a>. Failure to deallocate a results set before destroying the <a class="el" href="classOGRDataSource.html">OGRDataSource</a> may cause errors.<p>This method is the same as the C function OGR_L_ReleaseResultsSet().<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>poResultsSet</em> </td><td>the result of a previous <a class="el" href="classOGRDataSource.html#a6acc228db6513784a56ce12334a8c33">ExecuteSQL()</a> call. </td></tr> </table></dl></div></div><p><a class="anchor" name="1af1c7cf202f9a2ca2310bbfa3d00cca"></a><!-- doxytag: member="OGRDataSource::SyncToDisk" ref="1af1c7cf202f9a2ca2310bbfa3d00cca" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">OGRErr OGRDataSource::SyncToDisk </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table></div><div class="memdoc"><p>Flush pending changes to disk.<p>This call is intended to force the datasource to flush any pending writes to disk, and leave the disk file in a consistent state. It would not normally have any effect on read-only datasources.<p>Some data sources do not implement this method, and will still return OGRERR_NONE. An error is only returned if an error occurs while attempting to flush to disk.<p>The default implementation of this method just calls the <a class="el" href="classOGRDataSource.html#1af1c7cf202f9a2ca2310bbfa3d00cca">SyncToDisk()</a> method on each of the layers. Conceptionally, calling <a class="el" href="classOGRDataSource.html#1af1c7cf202f9a2ca2310bbfa3d00cca">SyncToDisk()</a> on a datasource should include any work that might be accomplished by calling <a class="el" href="classOGRDataSource.html#1af1c7cf202f9a2ca2310bbfa3d00cca">SyncToDisk()</a> on layers in that data source.<p>This method is the same as the C function OGR_DS_SyncToDisk().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>OGRERR_NONE if no error occurs (even if nothing is done) or an error code. </dd></dl></div></div><p><a class="anchor" name="82733127f4498fb4ee1d061d73dd549c"></a><!-- doxytag: member="OGRDataSource::Reference" ref="82733127f4498fb4ee1d061d73dd549c" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRDataSource::Reference </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Increment datasource reference count.<p>This method is the same as the C function OGR_DS_Reference().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the reference count after incrementing. </dd></dl></div></div><p><a class="anchor" name="538760ac249d06681fd26c383e678cb1"></a><!-- doxytag: member="OGRDataSource::Dereference" ref="538760ac249d06681fd26c383e678cb1" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRDataSource::Dereference </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Decrement datasource reference count.<p>This method is the same as the C function OGR_DS_Dereference().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the reference count after decrementing. </dd></dl></div></div><p><a class="anchor" name="fbfe92dec39e0271a473d4435c692c05"></a><!-- doxytag: member="OGRDataSource::GetRefCount" ref="fbfe92dec39e0271a473d4435c692c05" args="() const" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRDataSource::GetRefCount </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Fetch reference count.<p>This method is the same as the C function OGR_DS_GetRefCount().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the current reference count for the datasource object itself. </dd></dl></div></div><p><a class="anchor" name="a14e7f93d132cd24d120ecf86fb1971e"></a><!-- doxytag: member="OGRDataSource::GetSummaryRefCount" ref="a14e7f93d132cd24d120ecf86fb1971e" args="() const" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRDataSource::GetSummaryRefCount </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Fetch reference count of datasource and all owned layers.<p>This method is the same as the C function OGR_DS_GetSummaryRefCount().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the current summary reference count for the datasource and its layers. </dd></dl></div></div><p><a class="anchor" name="e4b1cb2d75f251cfb70d8a9c185a001d"></a><!-- doxytag: member="OGRDataSource::Release" ref="e4b1cb2d75f251cfb70d8a9c185a001d" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">OGRErr OGRDataSource::Release </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Drop a reference to this datasource, and if the reference count drops to zero close (destroy) the datasource. Internally this actually calls the OGRSFDriverRegistrary::ReleaseDataSource() method. This method is essentially a convenient alias.<p>This method is the same as the C function OGRReleaseDataSource().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>OGRERR_NONE on success or an error code. </dd></dl></div></div><p><a class="anchor" name="509b66e2ab7fd13e389ca3e633963af8"></a><!-- doxytag: member="OGRDataSource::GetDriver" ref="509b66e2ab7fd13e389ca3e633963af8" args="() const" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> * OGRDataSource::GetDriver </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Returns the driver that the dataset was opened with.<p>This method is the same as the C function OGR_DS_GetDriver().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>NULL if driver info is not available, or pointer to a driver owned by the OGRSFDriverManager. </dd></dl></div></div><p><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="ogrsf__frmts_8h-source.html">ogrsf_frmts.h</a><li>ogrsf_frmts.dox<li>ogrdatasource.cpp</ul><hr>Generated for GDAL by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1.</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -