本文整理汇总了C++中CSG_MetaData::Get_Property方法的典型用法代码示例。如果您正苦于以下问题:C++ CSG_MetaData::Get_Property方法的具体用法?C++ CSG_MetaData::Get_Property怎么用?C++ CSG_MetaData::Get_Property使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSG_MetaData
的用法示例。
在下文中一共展示了CSG_MetaData::Get_Property方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Assign
//---------------------------------------------------------
bool CSG_MetaData::Assign(const CSG_MetaData &MetaData, bool bAppend)
{
int i;
if( !bAppend )
{
Destroy();
Set_Name (MetaData.Get_Name ());
Set_Content (MetaData.Get_Content());
//-------------------------------------------------
for(i=0; i<MetaData.Get_Property_Count(); i++)
{
Add_Property(MetaData.Get_Property_Name(i), MetaData.Get_Property(i));
}
}
//-----------------------------------------------------
for(i=0; i<MetaData.Get_Children_Count(); i++)
{
Add_Child()->Assign(*MetaData.Get_Child(i), false);
}
return( true );
}
示例2: Assign
//---------------------------------------------------------
bool CSG_MetaData::Assign(const CSG_MetaData &MetaData, bool bAddChildren)
{
if( &MetaData != this )
{
Destroy();
Set_Name (MetaData.Get_Name ());
Set_Content (MetaData.Get_Content());
for(int i=0; i<MetaData.Get_Property_Count(); i++)
{
Add_Property(MetaData.Get_Property_Name(i), MetaData.Get_Property(i));
}
if( bAddChildren )
{
Add_Children(MetaData);
}
}
return( true );
}
示例3: Create
//---------------------------------------------------------
bool CWMS_Capabilities::Create(const CSG_String &Server, const CSG_String &Version)
{
Destroy();
int i;
CSG_String s = "http://" + Server;
s += "?SERVICE=WMS";
s += "&VERSION=" + Version;
s += "&REQUEST=GetCapabilities";
CSG_MetaData Capabilities;
if( !Capabilities.Create(s) )
{
return( false );
}
//-----------------------------------------------------
if( !Capabilities.Get_Property("version", m_Version) || !Capabilities("Service") || !Capabilities("Capability") )
{
return( false );
}
const CSG_MetaData &Service = Capabilities["Service"];
CAP_GET_STRING(Service, "Name" , m_Name , true);
CAP_GET_STRING(Service, "Title" , m_Title , true);
CAP_GET_STRING(Service, "Abstract" , m_Abstract , true);
CAP_GET____INT(Service, "LayerLimit", m_LayerLimit, false);
CAP_GET____INT(Service, "MaxWidth" , m_MaxWidth , false);
CAP_GET____INT(Service, "MaxHeight" , m_MaxHeight , false);
//-----------------------------------------------------
if( !Capabilities["Capability"]("Request") || !Capabilities["Capability"]["Request"](V_MAP(m_Version)) )
{
return( false );
}
const CSG_MetaData &GetMap = Capabilities["Capability"]["Request"][V_MAP(m_Version)];
for(i=0; i<GetMap.Get_Children_Count(); i++)
{
if( GetMap[i].Cmp_Name ("Format" )
&& (GetMap[i].Cmp_Content("image/png" )
|| GetMap[i].Cmp_Content("image/jpeg")
|| GetMap[i].Cmp_Content("image/gif" )
|| GetMap[i].Cmp_Content("image/tiff")) )
{
m_Formats += GetMap[i].Get_Content() + "|";
}
}
//-----------------------------------------------------
if( !Capabilities["Capability"]("Layer") )
{
return( false );
}
const CSG_MetaData &Layer = Capabilities["Capability"]["Layer"];
if( m_Version.Cmp("1.3.0") == 0 )
{
if( !Layer("EX_GeographicBoundingBox") )
{
return( false );
}
CAP_GET_DOUBLE(Layer["EX_GeographicBoundingBox"], "westBoundLongitude", m_Extent.xMin, true);
CAP_GET_DOUBLE(Layer["EX_GeographicBoundingBox"], "eastBoundLongitude", m_Extent.xMax, true);
CAP_GET_DOUBLE(Layer["EX_GeographicBoundingBox"], "southBoundLatitude", m_Extent.yMin, true);
CAP_GET_DOUBLE(Layer["EX_GeographicBoundingBox"], "northBoundLatitude", m_Extent.yMax, true);
}
else // version < 1.3.0
{
if( !Layer("LatLonBoundingBox")
|| !Layer["LatLonBoundingBox"].Get_Property("minx", m_Extent.xMin)
|| !Layer["LatLonBoundingBox"].Get_Property("maxx", m_Extent.xMax)
|| !Layer["LatLonBoundingBox"].Get_Property("miny", m_Extent.yMin)
|| !Layer["LatLonBoundingBox"].Get_Property("maxy", m_Extent.yMax) )
{
return( false );
}
}
for(i=0; i<Layer.Get_Children_Count(); i++)
{
if( Layer[i].Cmp_Name(V_SRS(m_Version)) )
{
m_Projections += Layer[i].Get_Content() + "|";
}
else if( Layer[i].Cmp_Name("Layer") )
{
m_Layers_Name += Layer[i].Get_Content("Name" );
m_Layers_Title += Layer[i].Get_Content("Title");
//.........这里部分代码省略.........
示例4: On_Execute
//---------------------------------------------------------
bool CPointCloud_Create_Tileshape_From_SPCVF::On_Execute(void)
{
CSG_String sFileName;
CSG_Shapes *pShapes;
CSG_MetaData SPCVF;
CSG_String sPathSPCVF, sFilePath;
int iPoints;
double dBBoxXMin, dBBoxYMin, dBBoxXMax, dBBoxYMax;
//-----------------------------------------------------
sFileName = Parameters("FILENAME")->asString();
pShapes = Parameters("TILE_SHP")->asShapes();
//-----------------------------------------------------
if( !SPCVF.Create(sFileName) || SPCVF.Get_Name().CmpNoCase(SG_T("SPCVFDataset")) )
{
SG_UI_Msg_Add_Error(_TL("Please provide a valid *.scpvf file!"));
return( false );
}
//-----------------------------------------------------
CSG_String sMethodPaths;
SPCVF.Get_Property(SG_T("Paths"), sMethodPaths);
if( !sMethodPaths.CmpNoCase(SG_T("absolute")) )
{
sPathSPCVF = SG_T("");
}
else if( !sMethodPaths.CmpNoCase(SG_T("relative")) )
{
sPathSPCVF = SG_File_Get_Path(sFileName);
sPathSPCVF.Replace(SG_T("\\"), SG_T("/"));
}
else
{
SG_UI_Msg_Add_Error(_TL("Encountered invalid path description in *.spcvf file!"));
return( false );
}
//-----------------------------------------------------
pShapes->Destroy();
pShapes->Add_Field(_TL("ID"), SG_DATATYPE_Int);
pShapes->Add_Field(_TL("Filepath"), SG_DATATYPE_String);
pShapes->Add_Field(_TL("File"), SG_DATATYPE_String);
pShapes->Add_Field(_TL("Points"), SG_DATATYPE_Int);
pShapes->Set_Name(CSG_String::Format(_TL("Tileshape_%s"), SG_File_Get_Name(sFileName, false).c_str()));
//-----------------------------------------------------
CSG_MetaData *pDatasets = SPCVF.Get_Child(SG_T("Datasets"));
for(int i=0; i<pDatasets->Get_Children_Count(); i++)
{
CSG_MetaData *pDataset = pDatasets->Get_Child(i);
CSG_MetaData *pBBox = pDataset->Get_Child(SG_T("BBox"));
pDataset->Get_Property(SG_T("File"), sFilePath);
pDataset->Get_Property(SG_T("Points"), iPoints);
pBBox->Get_Property(SG_T("XMin"), dBBoxXMin);
pBBox->Get_Property(SG_T("YMin"), dBBoxYMin);
pBBox->Get_Property(SG_T("XMax"), dBBoxXMax);
pBBox->Get_Property(SG_T("YMax"), dBBoxYMax);
//-----------------------------------------------------
CSG_Shape *pShape = pShapes->Add_Shape();
pShape->Add_Point(dBBoxXMin, dBBoxYMin);
pShape->Add_Point(dBBoxXMin, dBBoxYMax);
pShape->Add_Point(dBBoxXMax, dBBoxYMax);
pShape->Add_Point(dBBoxXMax, dBBoxYMin);
pShape->Set_Value(0, i + 1);
if( sPathSPCVF.Length() == 0 ) // absolute paths
{
pShape->Set_Value(1, sFilePath.BeforeLast('/'));
pShape->Set_Value(2, sFilePath.AfterLast('/'));
}
else // relative paths
{
pShape->Set_Value(1, sPathSPCVF);
pShape->Set_Value(2, sFilePath);
}
pShape->Set_Value(3, iPoints);
}
//-----------------------------------------------------
return( true );
//.........这里部分代码省略.........
示例5: _Add_History_OLD
//---------------------------------------------------------
bool CACTIVE_History::_Add_History_OLD(wxTreeItemId Parent, CSG_MetaData &Data)
{
if( !Parent.IsOk() )
{
return( false );
}
//-----------------------------------------------------
CSG_MetaData *pTool = Data("MODULE");
if( !pTool )
{
if( Data.Get_Children_Count() > 0 )
{
for(int i=0; i<Data.Get_Children_Count(); i++)
{
CSG_MetaData *pEntry = Data.Get_Child(i);
if( pEntry->Get_Children_Count() > 0 )
{
_Add_History_OLD(AppendItem(Parent, wxString::Format("%s", pEntry->Get_Name().c_str()), IMG_NODE), *pEntry);
}
else if( !pEntry->Get_Name().Cmp(SG_T("FILE")) )
{
AppendItem(Parent, wxString::Format("%s", pEntry->Get_Content().c_str()), IMG_FILE);
}
else
{
AppendItem(Parent, wxString::Format("[%s] %s", pEntry->Get_Name().c_str(), pEntry->Get_Content().c_str()), IMG_ENTRY);
}
}
}
else
{
AppendItem(Parent, Data.Get_Name().c_str(), IMG_FILE);
}
}
//-----------------------------------------------------
else
{
int i;
wxTreeItemId Tool = AppendItem(Parent, pTool->Get_Content().c_str(), IMG_TOOL);
//-------------------------------------------------
wxTreeItemId Options = AppendItem(Tool, _TL("Options"), IMG_ENTRY);
for(i=0; i<Data.Get_Children_Count(); i++) // Options
{
CSG_MetaData *pEntry = Data.Get_Child(i);
CSG_String Name = pEntry->Get_Property("name");
TSG_Parameter_Type Type = SG_Parameter_Type_Get_Type(pEntry->Get_Property("type"));
if( !pEntry->Get_Name().Cmp("OPTION") )
{
switch( Type )
{
case PARAMETER_TYPE_Bool:
case PARAMETER_TYPE_Int:
case PARAMETER_TYPE_Double:
case PARAMETER_TYPE_Degree:
case PARAMETER_TYPE_Date:
case PARAMETER_TYPE_Choice:
case PARAMETER_TYPE_Range:
case PARAMETER_TYPE_Table_Field:
case PARAMETER_TYPE_Table_Fields:
case PARAMETER_TYPE_String:
case PARAMETER_TYPE_Text:
case PARAMETER_TYPE_FilePath:
AppendItem(Options, wxString::Format("%s [%s]", Name.c_str(), pEntry->Get_Content().c_str()), IMG_ENTRY);
break;
case PARAMETER_TYPE_Grid_System:
if( pEntry->Get_Children_Count() == 0 )
{
AppendItem(Options, wxString::Format("%s [%s]", Name.c_str(), pEntry->Get_Content().c_str()), IMG_ENTRY);
}
break;
case PARAMETER_TYPE_FixedTable:
case PARAMETER_TYPE_Parameters:
break;
default:
break;
}
}
}
if( ItemHasChildren(Options) )
{
Expand(Options);
}
else
{
// Delete(Options);
SetItemText(Options, _TL("No Options"));
}
//.........这里部分代码省略.........
示例6: from_JSON
//---------------------------------------------------------
bool CSG_MetaData::from_JSON(const CSG_String &JSON)
{
Destroy();
Set_Name("root");
CSG_MetaData *pNode = this;
const SG_Char *pc = JSON.c_str();
while( *pc )
{
CSG_String Element;
for(bool bQuota=false;;)
{
SG_Char c = *pc++;
if( !c || c == '\n' ) { break; } else
{
if( c == '\"' )
{
Element += c; bQuota = !bQuota;
}
else if( bQuota || (c != ' ' && c != '\t' && c != ',') )
{
Element += c;
}
}
}
//-------------------------------------------------
if( Element.is_Empty() )
{
// nop
}
else if( Element.Find('[') >= 0 ) // array begins
{
pNode = pNode->Add_Child(Element.AfterFirst('\"').BeforeFirst('\"'));
pNode->Add_Property("array", 1);
}
else if( Element.Find(']') >= 0 ) // array ends
{
if( pNode != this )
{
pNode = pNode->Get_Parent();
}
}
else if( Element.Find('{') >= 0 ) // object begins
{
Element = Element.AfterFirst('\"').BeforeFirst('\"');
if( !Element.is_Empty() )
{
pNode = pNode->Add_Child(Element);
}
else if( pNode->Get_Property("array") )
{
pNode = pNode->Add_Child(CSG_String::Format("%d", pNode->Get_Children_Count()));
}
}
else if( Element.Find('}') >= 0 ) // object ends
{
if( pNode != this )
{
pNode = pNode->Get_Parent();
}
}
else
{
CSG_String Key (Element.AfterFirst('\"').BeforeFirst('\"'));
CSG_String Value(Element.AfterFirst(':'));
if( Value.Find('\"') > -1 )
{
Value = Value.AfterFirst('\"').BeforeFirst('\"');
}
pNode->Add_Child(Key, Value);
}
}
return( true );
}