本文整理汇总了C++中OGRLinearRing::_exportToWkb方法的典型用法代码示例。如果您正苦于以下问题:C++ OGRLinearRing::_exportToWkb方法的具体用法?C++ OGRLinearRing::_exportToWkb怎么用?C++ OGRLinearRing::_exportToWkb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OGRLinearRing
的用法示例。
在下文中一共展示了OGRLinearRing::_exportToWkb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportToWkb
OGRErr OGRPolygon::exportToWkb( OGRwkbByteOrder eByteOrder,
unsigned char * pabyData,
OGRwkbVariant eWkbVariant ) const
{
/* -------------------------------------------------------------------- */
/* Set the byte order. */
/* -------------------------------------------------------------------- */
pabyData[0] =
DB2_V72_UNFIX_BYTE_ORDER(static_cast<unsigned char>(eByteOrder));
/* -------------------------------------------------------------------- */
/* Set the geometry feature type. */
/* -------------------------------------------------------------------- */
GUInt32 nGType = getGeometryType();
if( eWkbVariant == wkbVariantPostGIS1 )
{
nGType = wkbFlatten(nGType);
if( Is3D() )
// Explicitly set wkb25DBit.
nGType =
static_cast<OGRwkbGeometryType>(nGType | wkb25DBitInternalUse);
if( IsMeasured() )
nGType = static_cast<OGRwkbGeometryType>(nGType | 0x40000000);
}
else if( eWkbVariant == wkbVariantIso )
nGType = getIsoGeometryType();
if( OGR_SWAP( eByteOrder ) )
{
nGType = CPL_SWAP32(nGType);
}
memcpy( pabyData + 1, &nGType, 4 );
/* -------------------------------------------------------------------- */
/* Copy in the raw data. */
/* -------------------------------------------------------------------- */
if( OGR_SWAP( eByteOrder ) )
{
const int nCount = CPL_SWAP32( oCC.nCurveCount );
memcpy( pabyData+5, &nCount, 4 );
}
else
{
memcpy( pabyData+5, &oCC.nCurveCount, 4 );
}
/* ==================================================================== */
/* Serialize each of the rings. */
/* ==================================================================== */
int nOffset = 9;
for( int iRing = 0; iRing < oCC.nCurveCount; iRing++ )
{
OGRLinearRing* poLR = (OGRLinearRing*) oCC.papoCurves[iRing];
poLR->_exportToWkb( eByteOrder, flags,
pabyData + nOffset );
nOffset += poLR->_WkbSize( flags );
}
return OGRERR_NONE;
}