本文整理汇总了C++中DocumentPtr::get_schema_array_at方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentPtr::get_schema_array_at方法的具体用法?C++ DocumentPtr::get_schema_array_at怎么用?C++ DocumentPtr::get_schema_array_at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentPtr
的用法示例。
在下文中一共展示了DocumentPtr::get_schema_array_at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oOgrFieldName
//.........这里部分代码省略.........
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldTessellate );
/***** extrude field *****/
OGRFieldDefn oOgrFieldExtrude ( oFC.extrudefield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldExtrude );
/***** visibility field *****/
OGRFieldDefn oOgrFieldVisibility ( oFC.visibilityfield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldVisibility );
/***** draw order field *****/
OGRFieldDefn oOgrFieldDrawOrder ( oFC.drawOrderfield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldDrawOrder );
/***** icon field *****/
OGRFieldDefn oOgrFieldIcon ( oFC.iconfield, OFTString );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldIcon );
/***** get the styles *****/
if ( m_poKmlLayer->IsA ( kmldom::Type_Document ) )
ParseStyles ( AsDocument ( m_poKmlLayer ), &m_poStyleTable );
/***** get the schema if the layer is a Document *****/
if ( m_poKmlLayer->IsA ( kmldom::Type_Document ) ) {
DocumentPtr poKmlDocument = AsDocument ( m_poKmlLayer );
if ( poKmlDocument->get_schema_array_size ( ) ) {
m_poKmlSchema = poKmlDocument->get_schema_array_at ( 0 );
kml2FeatureDef ( m_poKmlSchema, m_poOgrFeatureDefn );
}
}
/***** the schema is somewhere else *****/
if (m_poKmlSchema == NULL) {
/***** try to find the correct schema *****/
int bHasHeading = FALSE, bHasTilt = FALSE, bHasRoll = FALSE;
int bHasSnippet = FALSE;
FeaturePtr poKmlFeature;
/***** find the first placemark *****/
do {
if ( iFeature >= nFeatures )
break;
poKmlFeature =
m_poKmlLayer->get_feature_array_at ( iFeature++ );
if( poKmlFeature->Type() == kmldom::Type_Placemark )
{
PlacemarkPtr poKmlPlacemark = AsPlacemark ( poKmlFeature );
if( !poKmlPlacemark->has_geometry ( ) &&
poKmlPlacemark->has_abstractview ( ) &&
poKmlPlacemark->get_abstractview()->IsA( kmldom::Type_Camera) )
{
const CameraPtr& camera = AsCamera(poKmlPlacemark->get_abstractview());
if( camera->has_heading() && !bHasHeading )
示例2: oOgrFieldName
//.........这里部分代码省略.........
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldAltitudeMode );
OGRFieldDefn oOgrFieldTessellate (
tessellatefield,
OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldTessellate );
OGRFieldDefn oOgrFieldExtrude (
extrudefield,
OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldExtrude );
OGRFieldDefn oOgrFieldVisibility (
visibilityfield,
OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn ( &oOgrFieldVisibility );
/***** get the styles *****/
if ( m_poKmlLayer->IsA ( kmldom::Type_Document ) )
ParseStyles ( AsDocument ( m_poKmlLayer ), &m_poStyleTable );
/***** get the schema if the layer is a Document *****/
m_poKmlSchema = NULL;
if ( m_poKmlLayer->IsA ( kmldom::Type_Document ) ) {
DocumentPtr poKmlDocument = AsDocument ( m_poKmlLayer );
if ( poKmlDocument->get_schema_array_size ( ) ) {
m_poKmlSchema = poKmlDocument->get_schema_array_at ( 0 );
kml2FeatureDef ( m_poKmlSchema, m_poOgrFeatureDefn );
}
}
/***** the schema is somewhere else *****/
if (m_poKmlSchema == NULL) {
/***** try to find the correct schema *****/
FeaturePtr poKmlFeature;
/***** find the first placemark *****/
do {
if ( iFeature >= nFeatures )
break;
poKmlFeature =
m_poKmlLayer->get_feature_array_at ( iFeature++ );
} while ( poKmlFeature->Type ( ) != kmldom::Type_Placemark );
if ( iFeature <= nFeatures && poKmlFeature &&
poKmlFeature->Type ( ) == kmldom::Type_Placemark &&
poKmlFeature->has_extendeddata ( ) ) {
ExtendedDataPtr poKmlExtendedData = poKmlFeature->
get_extendeddata ( );
if ( poKmlExtendedData->get_schemadata_array_size ( ) > 0 ) {
SchemaDataPtr poKmlSchemaData = poKmlExtendedData->
示例3: oOgrFieldName
//.........这里部分代码省略.........
m_poOgrFeatureDefn->AddFieldDefn( &oOgrFieldTessellate );
/***** extrude field *****/
OGRFieldDefn oOgrFieldExtrude( oFC.extrudefield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn( &oOgrFieldExtrude );
/***** visibility field *****/
OGRFieldDefn oOgrFieldVisibility( oFC.visibilityfield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn( &oOgrFieldVisibility );
/***** draw order field *****/
OGRFieldDefn oOgrFieldDrawOrder( oFC.drawOrderfield, OFTInteger );
m_poOgrFeatureDefn->AddFieldDefn( &oOgrFieldDrawOrder );
/***** icon field *****/
OGRFieldDefn oOgrFieldIcon( oFC.iconfield, OFTString );
m_poOgrFeatureDefn->AddFieldDefn( &oOgrFieldIcon );
/***** get the styles *****/
if( m_poKmlLayer->IsA( kmldom::Type_Document ) )
ParseStyles( AsDocument ( m_poKmlLayer ), &m_poStyleTable );
bool bCanSetKmlSchema = true;
/***** get the schema if the layer is a Document *****/
if( m_poKmlLayer->IsA( kmldom::Type_Document ) )
{
DocumentPtr poKmlDocument = AsDocument( m_poKmlLayer );
if( poKmlDocument->get_schema_array_size() )
{
for(size_t i = 0; i < poKmlDocument->get_schema_array_size(); i++ )
{
auto schema = poKmlDocument->get_schema_array_at( i );
if( bCanSetKmlSchema && !m_poKmlSchema )
{
m_poKmlSchema = schema;
bCanSetKmlSchema = false;
}
else
{
m_poKmlSchema = nullptr;
}
kml2FeatureDef( schema, m_poOgrFeatureDefn );
}
}
}
/***** the schema is somewhere else *****/
if( bCanSetKmlSchema )
{
/***** try to find the correct schema *****/
bool bHasHeading = false;
bool bHasTilt = false;
bool bHasRoll = false;
bool bHasSnippet = false;
FeaturePtr poKmlFeature = nullptr;
const bool bLaunderFieldNames =
CPLTestBool(CPLGetConfigOption(
"LIBKML_LAUNDER_FIELD_NAMES", "YES"));
std::set<std::string> oSetSchemaAlreadyVisited;
/***** find the first placemark *****/
for( iFeature = 0; iFeature < nFeatures; iFeature++ )
{
poKmlFeature =