本文整理汇总了C++中OGRFeatureDefn::AddGeomFieldDefn方法的典型用法代码示例。如果您正苦于以下问题:C++ OGRFeatureDefn::AddGeomFieldDefn方法的具体用法?C++ OGRFeatureDefn::AddGeomFieldDefn怎么用?C++ OGRFeatureDefn::AddGeomFieldDefn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OGRFeatureDefn
的用法示例。
在下文中一共展示了OGRFeatureDefn::AddGeomFieldDefn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddGeomField
void AddGeomField(const char* psName, OGRwkbGeometryType geomType)
{
OGRGeomFieldDefn fieldDef(psName, geomType);
//oGFld.SetSpatialRef(geomlayer->GetSpatialRef());
poTableDefn->AddGeomFieldDefn(&fieldDef);
CPLDebug( "OGR_ILI", "Adding geometry field '%s' to Class %s", psName, GetName());
}
示例2:
OGRErr OGRLayerWithTransaction::CreateGeomField( OGRGeomFieldDefn *poField,
int bApproxOK )
{
if( !m_poDecoratedLayer ) return OGRERR_FAILURE;
int nFields = m_poDecoratedLayer->GetLayerDefn()->GetGeomFieldCount();
OGRErr eErr = m_poDecoratedLayer->CreateGeomField(poField, bApproxOK);
if( m_poFeatureDefn && eErr == OGRERR_NONE && m_poDecoratedLayer->GetLayerDefn()->GetGeomFieldCount() == nFields + 1 )
{
m_poFeatureDefn->AddGeomFieldDefn( m_poDecoratedLayer->GetLayerDefn()->GetGeomFieldDefn(nFields) );
}
return eErr;
}
示例3: AddGeomTable
// Add additional Geometry table for Interlis 1
void AddGeomTable(CPLString layerName, const char* psFieldName, OGRwkbGeometryType eType, bool bRefTIDField = false)
{
OGRFeatureDefn* poGeomTableDefn = new OGRFeatureDefn(layerName);
OGRFieldDefn fieldDef("_TID", OFTString);
poGeomTableDefn->AddFieldDefn(&fieldDef);
if (bRefTIDField)
{
OGRFieldDefn fieldDefRef("_RefTID", OFTString);
poGeomTableDefn->AddFieldDefn(&fieldDefRef);
}
poGeomTableDefn->DeleteGeomFieldDefn(0);
OGRGeomFieldDefn fieldDefGeom(psFieldName, eType);
poGeomTableDefn->AddGeomFieldDefn(&fieldDefGeom);
CPLDebug( "OGR_ILI", "Adding geometry table %s for field %s", poGeomTableDefn->GetName(), psFieldName);
poGeomFieldInfos[psFieldName].geomTable = poGeomTableDefn;
}
示例4: OGRFeatureDefn
OGRFeatureDefn *OGRFeatureDefn::Clone()
{
int i;
OGRFeatureDefn *poCopy;
poCopy = new OGRFeatureDefn( GetName() );
GetFieldCount();
for( i = 0; i < nFieldCount; i++ )
poCopy->AddFieldDefn( GetFieldDefn( i ) );
/* There is a default geometry field created at OGRFeatureDefn instanciation */
poCopy->DeleteGeomFieldDefn(0);
GetGeomFieldCount();
for( i = 0; i < nGeomFieldCount; i++ )
poCopy->AddGeomFieldDefn( GetGeomFieldDefn( i ) );
return poCopy;
}