使用了以下代码进行查询,但是查询到的结果(UGRecordsetPtr)为空。麻烦帮看一下。
int nPntCount=points.length();
UGPoint2D *pUGPoint2d = new UGPoint2D[nPntCount];
if (NULL == pUGPoint2d)
{
return false;
}
for (size_t i = 0; i < nPntCount; i++)
{
pUGPoint2d[i].x = points.at(i).x;
pUGPoint2d[i].y = points.at(i).y;
}
UGGeoRegion *uRegion=new UGGeoRegion;
UGbool bAdd = pRegion->Make(pUGPoint2d,nPntCount);
if (!bAdd)
{
delete[] pUGPoint2d;
pUGPoint2d = NULL;
return;
}
UGQueryDef queryDef;
queryDef.m_nType = UGQueryDef::Contains;
pRegion->ToElement(queryDef.m_pElement);
UGRecordsetPtr recordset = pDataset->Query(queryDef);
if(recordset==NULL)
{
return false;
}