本文整理汇总了C++中GeoVector::SetNumberOfPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoVector::SetNumberOfPoints方法的具体用法?C++ GeoVector::SetNumberOfPoints怎么用?C++ GeoVector::SetNumberOfPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoVector
的用法示例。
在下文中一共展示了GeoVector::SetNumberOfPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
//.........这里部分代码省略.........
std::string metaData = poFeature->GetFieldAsString(iField);
// do something with the meta data...
//Log::Inst().Write(metaData);
}
count++;
if(progressDlg)
{
if(!progressDlg->Update(int(50 + (float(count)/numFeatures)*50)))
return false;
}
///////////////////////////////////////////////////
// PHASE 2: Retrieve GEOMETRIES from the dataset //
///////////////////////////////////////////////////
OGRGeometry *poGeometry;
poGeometry = poFeature->GetGeometryRef();
// Move to the next feature in the set if no geometry present
if( poGeometry == NULL )
{
OGRFeature::DestroyFeature( poFeature );
continue;
}
OGRwkbGeometryType whatisit = poGeometry->getGeometryType();
// Handle POINTS
if ( wkbFlatten( poGeometry->getGeometryType() ) == wkbPoint )
{
GeoVector* geoVector = new GeoVector();
OGRPoint *poPoint = (OGRPoint *) poGeometry;
geoVector->SetGeometryType( wkbPoint );
geoVector->SetNumberOfPoints( 1 );
if(needProjection)
{
double x,y;
x= poPoint->getX();
y= poPoint->getY();
if(!poTransform->Transform(1, &x, &y))
{
Log::Inst().Warning("(Warning) Failed to project vector map.");
OGRDataset->DestroyDataSource(OGRDataset);
return false;
}
// project and store the points
geoVector->pointX[0] = x;
geoVector->pointY[0] = y;
if(x < minX) minX=x;
if(y < minY) minY=y;
if(x > maxX) maxX=x;
if(y > maxY) maxY=y;
}
else
{
geoVector->pointX[0] = poPoint->getX();
geoVector->pointY[0] = poPoint->getY();
}
vectorMapController->GetVectorMapModel()->AddGeoVector( geoVector );
}
//Handle MultiPoint
else if ( wkbFlatten( poGeometry->getGeometryType() ) == wkbMultiPoint )