本文整理汇总了C++中OGRPoint::Is3D方法的典型用法代码示例。如果您正苦于以下问题:C++ OGRPoint::Is3D方法的具体用法?C++ OGRPoint::Is3D怎么用?C++ OGRPoint::Is3D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OGRPoint
的用法示例。
在下文中一共展示了OGRPoint::Is3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportToWkt
OGRErr OGRMultiPoint::exportToWkt( char ** ppszDstText,
OGRwkbVariant eWkbVariant ) const
{
size_t nMaxString = static_cast<size_t>(getNumGeometries()) * 22 + 130;
size_t nRetLen = 0;
/* -------------------------------------------------------------------- */
/* Return MULTIPOINT EMPTY if we get no valid points. */
/* -------------------------------------------------------------------- */
if( IsEmpty() )
{
if( eWkbVariant == wkbVariantIso )
{
if( (flags & OGR_G_3D) && (flags & OGR_G_MEASURED) )
*ppszDstText = CPLStrdup("MULTIPOINT ZM EMPTY");
else if( flags & OGR_G_MEASURED )
*ppszDstText = CPLStrdup("MULTIPOINT M EMPTY");
else if( flags & OGR_G_3D )
*ppszDstText = CPLStrdup("MULTIPOINT Z EMPTY");
else
*ppszDstText = CPLStrdup("MULTIPOINT EMPTY");
}
else
*ppszDstText = CPLStrdup("MULTIPOINT EMPTY");
return OGRERR_NONE;
}
*ppszDstText = static_cast<char *>(VSI_MALLOC_VERBOSE( nMaxString ));
if( *ppszDstText == NULL )
return OGRERR_NOT_ENOUGH_MEMORY;
if( eWkbVariant == wkbVariantIso )
{
if( (flags & OGR_G_3D) && (flags & OGR_G_MEASURED) )
snprintf( *ppszDstText, nMaxString, "%s ZM (", getGeometryName() );
else if( flags & OGR_G_MEASURED )
snprintf( *ppszDstText, nMaxString, "%s M (", getGeometryName() );
else if( flags & OGR_G_3D )
snprintf( *ppszDstText, nMaxString, "%s Z (", getGeometryName() );
else
snprintf( *ppszDstText, nMaxString, "%s (", getGeometryName() );
}
else
snprintf( *ppszDstText, nMaxString, "%s (", getGeometryName() );
bool bMustWriteComma = false;
for( int i = 0; i < getNumGeometries(); i++ )
{
OGRPoint *poPoint = (OGRPoint *) getGeometryRef( i );
if( poPoint->IsEmpty() )
{
CPLDebug("OGR",
"OGRMultiPoint::exportToWkt() - skipping POINT EMPTY.");
continue;
}
if( bMustWriteComma )
strcat( *ppszDstText + nRetLen, "," );
bMustWriteComma = true;
nRetLen += strlen(*ppszDstText + nRetLen);
if( nMaxString < nRetLen + 100 )
{
nMaxString = nMaxString * 2;
*ppszDstText =
static_cast<char *>(CPLRealloc(*ppszDstText, nMaxString));
}
if( eWkbVariant == wkbVariantIso )
{
strcat( *ppszDstText + nRetLen, "(" );
nRetLen++;
}
OGRMakeWktCoordinateM(
*ppszDstText + nRetLen,
poPoint->getX(),
poPoint->getY(),
poPoint->getZ(),
poPoint->getM(),
poPoint->Is3D(),
poPoint->IsMeasured() && (eWkbVariant == wkbVariantIso));
if( eWkbVariant == wkbVariantIso )
{
strcat( *ppszDstText + nRetLen, ")" );
nRetLen++;
}
}
strcat( *ppszDstText+nRetLen, ")" );
return OGRERR_NONE;
}