本文整理汇总了C++中OGRLayer::SetIgnoredFields方法的典型用法代码示例。如果您正苦于以下问题:C++ OGRLayer::SetIgnoredFields方法的具体用法?C++ OGRLayer::SetIgnoredFields怎么用?C++ OGRLayer::SetIgnoredFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OGRLayer
的用法示例。
在下文中一共展示了OGRLayer::SetIgnoredFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oMutexHolder
//.........这里部分代码省略.........
if( rc == SQLITE_OK )
{
const char* pszInsertInto = CPLSPrintf(
"INSERT INTO \"%s\" (pkid, xmin, xmax, ymin, ymax) "
"VALUES (?,?,?,?,?)", osIdxNameEscaped.c_str());
rc = sqlite3_prepare(hDB, pszInsertInto, -1, &hStmt, NULL);
}
OGRFeature* poFeature;
OGREnvelope sEnvelope;
OGR2SQLITE_IgnoreAllFieldsExceptGeometry(poLayer);
poLayer->ResetReading();
while( rc == SQLITE_OK &&
(poFeature = poLayer->GetNextFeature()) != NULL )
{
OGRGeometry* poGeom = poFeature->GetGeometryRef();
if( poGeom != NULL && !poGeom->IsEmpty() )
{
poGeom->getEnvelope(&sEnvelope);
sqlite3_bind_int64(hStmt, 1,
(sqlite3_int64) poFeature->GetFID() );
sqlite3_bind_double(hStmt, 2, sEnvelope.MinX);
sqlite3_bind_double(hStmt, 3, sEnvelope.MaxX);
sqlite3_bind_double(hStmt, 4, sEnvelope.MinY);
sqlite3_bind_double(hStmt, 5, sEnvelope.MaxY);
rc = sqlite3_step(hStmt);
if( rc == SQLITE_OK || rc == SQLITE_DONE )
rc = sqlite3_reset(hStmt);
}
delete poFeature;
}
poLayer->SetIgnoredFields(NULL);
sqlite3_finalize(hStmt);
if( rc == SQLITE_OK )
rc = sqlite3_exec( hDB, "COMMIT", NULL, NULL, NULL );
else
{
CPLDebug("SQLITE",
"Error occured during spatial index creation : %s",
sqlite3_errmsg(hDB));
rc = sqlite3_exec( hDB, "ROLLBACK", NULL, NULL, NULL );
}
#endif // ENABLE_VIRTUAL_OGR_SPATIAL_INDEX
#endif // HAVE_SPATIALITE
}
/* -------------------------------------------------------------------- */
/* Reload, so that virtual tables are recognized */
/* -------------------------------------------------------------------- */
poSQLiteDS->ReloadLayers();
/* -------------------------------------------------------------------- */
/* Prepare the statement. */
/* -------------------------------------------------------------------- */
/* This will speed-up layer creation */
/* ORDER BY are costly to evaluate and are not necessary to establish */
/* the layer definition. */
int bUseStatementForGetNextFeature = TRUE;
int bEmptyLayer = FALSE;