本文整理汇总了C++中GMLPropertyDefn::SetAttributeIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ GMLPropertyDefn::SetAttributeIndex方法的具体用法?C++ GMLPropertyDefn::SetAttributeIndex怎么用?C++ GMLPropertyDefn::SetAttributeIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMLPropertyDefn
的用法示例。
在下文中一共展示了GMLPropertyDefn::SetAttributeIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GMLParseFeatureType
//.........这里部分代码省略.........
nAttributeIndex ++;
continue;
}
/* ERDAS Apollo stuff (like in http://apollo.erdas.com/erdas-apollo/vector/WORLDWIDE?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=wfs:cntry98) */
else if (strcmp(pszType, "wfs:MixedPolygonPropertyType") == 0)
{
poClass->SetGeometryElement(pszElementName);
poClass->SetGeometryType(wkbMultiPolygon);
poClass->SetGeometryAttributeIndex( nAttributeIndex );
nAttributeIndex ++;
continue;
}
else
{
gmlType = GMLPT_Untyped;
if ( ! LookForSimpleType(psSchemaNode, pszStrippedNSType,
&gmlType, &nWidth, &nPrecision) )
{
/* Too complex schema for us. Aborts parsing */
delete poClass;
return NULL;
}
}
if (pszElementName == NULL)
pszElementName = "unnamed";
GMLPropertyDefn *poProp = new GMLPropertyDefn(
pszElementName, pszElementName );
poProp->SetType( gmlType );
poProp->SetAttributeIndex( nAttributeIndex );
poProp->SetWidth( nWidth );
poProp->SetPrecision( nPrecision );
if (poClass->AddProperty( poProp ) < 0)
delete poProp;
else
nAttributeIndex ++;
continue;
}
// For now we skip geometries .. fixup later.
CPLXMLNode* psSimpleType = CPLGetXMLNode( psAttrDef, "simpleType" );
if( psSimpleType == NULL )
{
const char* pszRef = CPLGetXMLValue( psAttrDef, "ref", NULL );
/* FME .xsd */
if (pszRef != NULL && strncmp(pszRef, "gml:", 4) == 0)
{
const AssocNameType* psIter = apsRefTypes;
while(psIter->pszName)
{
if (strncmp(pszRef + 4, psIter->pszName, strlen(psIter->pszName)) == 0)
{
if (poClass->GetGeometryAttributeIndex() != -1)
{
OGRwkbGeometryType eNewType = psIter->eType;
OGRwkbGeometryType eOldType = (OGRwkbGeometryType)poClass->GetGeometryType();
if ((eNewType == wkbMultiPoint && eOldType == wkbPoint) ||
(eNewType == wkbMultiLineString && eOldType == wkbLineString) ||
(eNewType == wkbMultiPolygon && eOldType == wkbPolygon))