本文整理汇总了C++中DataSet::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSet::GetType方法的具体用法?C++ DataSet::GetType怎么用?C++ DataSet::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSet
的用法示例。
在下文中一共展示了DataSet::GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
WebResponse* GetPreviewHandler::Execute(WebRequest* pWebRequest, User* pUser)
{
GetPreviewRequest* pRequest = static_cast<GetPreviewRequest*>(pWebRequest);
const char* sourceName = pRequest->GetSourceName();
const char* dataSetName= pRequest->GetDataSetName();
if(sourceName==NULL)
{
const char* msg = "Parameter [sourceName] is NULL";
GLogger* pLogger = augeGetLoggerInstance();
pLogger->Error(msg, __FILE__, __LINE__);
WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
pExpResponse->SetMessage(msg);
return pExpResponse;
}
Workspace* pWorkspace = NULL;
ConnectionManager* pConnectionManager = augeGetConnectionManagerInstance();
pWorkspace = pConnectionManager->GetWorkspace(pUser->GetID(), sourceName);
if( pWorkspace==NULL )
{
char msg[AUGE_PATH_MAX] = {0};
g_sprintf(msg, "Cannot load datasource [%s].", sourceName);
GLogger* pLogger = augeGetLoggerInstance();
pLogger->Error(msg, __FILE__, __LINE__);
WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
pExpResponse->SetMessage(msg);
return pExpResponse;
}
DataSet* pDataSet = pWorkspace->OpenDataSet(dataSetName);
if(pDataSet==NULL)
{
char msg[AUGE_PATH_MAX] = {0};
g_sprintf(msg, "Cannot load data set [%s].", dataSetName);
GLogger* pLogger = augeGetLoggerInstance();
pLogger->Error(msg, __FILE__, __LINE__);
WebExceptionResponse* pExpResponse = augeCreateWebExceptionResponse();
pExpResponse->SetMessage(msg);
return pExpResponse;
}
WebResponse* pWebResponse = NULL;
switch(pDataSet->GetType())
{
case augeDataSetFeature:
{
FeatureClass* pFeatureClass = static_cast<FeatureClass*>(pDataSet);
char img_sfix[AUGE_EXT_MAX] = {0};
char img_path[AUGE_PATH_MAX] = {0};
auge_get_image_suffix(pRequest->GetMimeType(), img_sfix, AUGE_EXT_MAX);
WebContext* pWebContext = augeGetWebContextInstance();
auge_make_path(img_path, NULL, pWebContext->GetCacheMapPath(), pFeatureClass->GetUUID(), img_sfix);
if(!g_access(img_path, 4))
{
GetPreviewResponse* pMapResponse = new GetPreviewResponse(pRequest);
pMapResponse->SetPath(img_path);
pWebResponse = pMapResponse;
}
else
{
pWebResponse = DrawFeature(pFeatureClass,pRequest);
}
}
break;
case augeDataSetRaster:
break;
}
return pWebResponse;
}