本文整理汇总了C++中GMLPropertyDefn::GetSrcElement方法的典型用法代码示例。如果您正苦于以下问题:C++ GMLPropertyDefn::GetSrcElement方法的具体用法?C++ GMLPropertyDefn::GetSrcElement怎么用?C++ GMLPropertyDefn::GetSrcElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMLPropertyDefn
的用法示例。
在下文中一共展示了GMLPropertyDefn::GetSrcElement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CPLCreateXMLNode
CPLXMLNode *GMLFeatureClass::SerializeToXML()
{
CPLXMLNode *psRoot;
int iProperty;
/* -------------------------------------------------------------------- */
/* Set feature class and core information. */
/* -------------------------------------------------------------------- */
psRoot = CPLCreateXMLNode( NULL, CXT_Element, "GMLFeatureClass" );
CPLCreateXMLElementAndValue( psRoot, "Name", GetName() );
CPLCreateXMLElementAndValue( psRoot, "ElementPath", GetElementName() );
if( GetGeometryElement() != NULL && strlen(GetGeometryElement()) > 0 )
CPLCreateXMLElementAndValue( psRoot, "GeometryElementPath",
GetGeometryElement() );
if( GetGeometryType() != 0 /* wkbUnknown */ )
{
char szValue[128];
sprintf( szValue, "%d", GetGeometryType() );
CPLCreateXMLElementAndValue( psRoot, "GeometryType", szValue );
}
/* -------------------------------------------------------------------- */
/* Write out dataset specific information. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psDSI;
if( m_bHaveExtents || m_nFeatureCount != -1 || m_pszExtraInfo != NULL )
{
psDSI = CPLCreateXMLNode( psRoot, CXT_Element, "DatasetSpecificInfo" );
if( m_nFeatureCount != -1 )
{
char szValue[128];
sprintf( szValue, "%d", m_nFeatureCount );
CPLCreateXMLElementAndValue( psDSI, "FeatureCount", szValue );
}
if( m_bHaveExtents )
{
char szValue[128];
sprintf( szValue, "%.5f", m_dfXMin );
CPLCreateXMLElementAndValue( psDSI, "ExtentXMin", szValue );
sprintf( szValue, "%.5f", m_dfXMax );
CPLCreateXMLElementAndValue( psDSI, "ExtentXMax", szValue );
sprintf( szValue, "%.5f", m_dfYMin );
CPLCreateXMLElementAndValue( psDSI, "ExtentYMin", szValue );
sprintf( szValue, "%.5f", m_dfYMax );
CPLCreateXMLElementAndValue( psDSI, "ExtentYMax", szValue );
}
if( m_pszExtraInfo )
CPLCreateXMLElementAndValue( psDSI, "ExtraInfo", m_pszExtraInfo );
}
/* -------------------------------------------------------------------- */
/* emit property information. */
/* -------------------------------------------------------------------- */
for( iProperty = 0; iProperty < GetPropertyCount(); iProperty++ )
{
GMLPropertyDefn *poPDefn = GetProperty( iProperty );
CPLXMLNode *psPDefnNode;
const char *pszTypeName = "Unknown";
psPDefnNode = CPLCreateXMLNode( psRoot, CXT_Element, "PropertyDefn" );
CPLCreateXMLElementAndValue( psPDefnNode, "Name",
poPDefn->GetName() );
CPLCreateXMLElementAndValue( psPDefnNode, "ElementPath",
poPDefn->GetSrcElement() );
switch( poPDefn->GetType() )
{
case GMLPT_Untyped:
pszTypeName = "Untyped";
break;
case GMLPT_String:
pszTypeName = "String";
break;
case GMLPT_Integer:
pszTypeName = "Integer";
break;
case GMLPT_Real:
pszTypeName = "Real";
break;
case GMLPT_Complex:
pszTypeName = "Complex";
break;
case GMLPT_IntegerList:
//.........这里部分代码省略.........
示例2: osStr
CPLXMLNode *GMLFeatureClass::SerializeToXML()
{
CPLXMLNode *psRoot;
int iProperty;
/* -------------------------------------------------------------------- */
/* Set feature class and core information. */
/* -------------------------------------------------------------------- */
psRoot = CPLCreateXMLNode( NULL, CXT_Element, "GMLFeatureClass" );
CPLCreateXMLElementAndValue( psRoot, "Name", GetName() );
CPLCreateXMLElementAndValue( psRoot, "ElementPath", GetElementName() );
if( m_nGeometryPropertyCount > 1 )
{
for(int i=0; i < m_nGeometryPropertyCount; i++)
{
GMLGeometryPropertyDefn* poGeomFDefn = m_papoGeometryProperty[i];
CPLXMLNode *psPDefnNode;
psPDefnNode = CPLCreateXMLNode( psRoot, CXT_Element, "GeomPropertyDefn" );
if( strlen(poGeomFDefn->GetName()) > 0 )
CPLCreateXMLElementAndValue( psPDefnNode, "Name",
poGeomFDefn->GetName() );
if( poGeomFDefn->GetSrcElement() != NULL && strlen(poGeomFDefn->GetSrcElement()) > 0 )
CPLCreateXMLElementAndValue( psPDefnNode, "ElementPath",
poGeomFDefn->GetSrcElement() );
if( poGeomFDefn->GetType() != 0 /* wkbUnknown */ )
{
char szValue[128];
OGRwkbGeometryType eType = (OGRwkbGeometryType)poGeomFDefn->GetType();
CPLString osStr(OGRToOGCGeomType(eType));
if( wkbHasZ(eType) ) osStr += "Z";
CPLCreateXMLNode( psPDefnNode, CXT_Comment, osStr.c_str() );
sprintf( szValue, "%d", eType );
CPLCreateXMLElementAndValue( psPDefnNode, "Type", szValue );
}
}
}
else if( m_nGeometryPropertyCount == 1 )
{
GMLGeometryPropertyDefn* poGeomFDefn = m_papoGeometryProperty[0];
if( strlen(poGeomFDefn->GetName()) > 0 )
CPLCreateXMLElementAndValue( psRoot, "GeometryName",
poGeomFDefn->GetName() );
if( poGeomFDefn->GetSrcElement() != NULL && strlen(poGeomFDefn->GetSrcElement()) > 0 )
CPLCreateXMLElementAndValue( psRoot, "GeometryElementPath",
poGeomFDefn->GetSrcElement() );
if( poGeomFDefn->GetType() != 0 /* wkbUnknown */ )
{
char szValue[128];
OGRwkbGeometryType eType = (OGRwkbGeometryType)poGeomFDefn->GetType();
CPLString osStr(OGRToOGCGeomType(eType));
if( wkbHasZ(eType) ) osStr += "Z";
CPLCreateXMLNode( psRoot, CXT_Comment, osStr.c_str() );
sprintf( szValue, "%d", eType );
CPLCreateXMLElementAndValue( psRoot, "GeometryType", szValue );
}
}
else
{
CPLCreateXMLElementAndValue( psRoot, "GeometryType", "100" );
}
const char* pszSRSName = GetSRSName();
if( pszSRSName )
{
CPLCreateXMLElementAndValue( psRoot, "SRSName", pszSRSName );
}
/* -------------------------------------------------------------------- */
/* Write out dataset specific information. */
/* -------------------------------------------------------------------- */
CPLXMLNode *psDSI;
if( m_bHaveExtents || m_nFeatureCount != -1 || m_pszExtraInfo != NULL )
{
psDSI = CPLCreateXMLNode( psRoot, CXT_Element, "DatasetSpecificInfo" );
if( m_nFeatureCount != -1 )
{
char szValue[128];
sprintf( szValue, CPL_FRMT_GIB, m_nFeatureCount );
CPLCreateXMLElementAndValue( psDSI, "FeatureCount", szValue );
}
if( m_bHaveExtents &&
fabs(m_dfXMin) < 1e100 &&
//.........这里部分代码省略.........