本文整理汇总了C++中TPosition::Datum方法的典型用法代码示例。如果您正苦于以下问题:C++ TPosition::Datum方法的具体用法?C++ TPosition::Datum怎么用?C++ TPosition::Datum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPosition
的用法示例。
在下文中一共展示了TPosition::Datum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintPosInfo
EXPORT_C void MTe_LbsPsyStaticData::PrintPosInfo(const TPositionInfo& aPosInfo) const
{
_LIT(KTimeFormat, "%H:%T:%S.%C");
TBuf<100> cTimeStr;
INFO_PRINTF2(_L("classSize=%d"), aPosInfo.PositionClassSize());
INFO_PRINTF2(_L("classType=0x%x"), aPosInfo.PositionClassType());
INFO_PRINTF2(_L("moduleId=0x%x"), aPosInfo.ModuleId());
INFO_PRINTF2(_L("updateType=%d"), aPosInfo.UpdateType());
INFO_PRINTF2(_L("positionMode=%d"), aPosInfo.PositionMode());
INFO_PRINTF2(_L("positionModeReason=%d"), aPosInfo.PositionModeReason());
TPosition pos;
aPosInfo.GetPosition(pos);
INFO_PRINTF2(_L("pos altitude=%f"), pos.Altitude());
INFO_PRINTF2(_L("pos latitude=%f"), pos.Latitude());
INFO_PRINTF2(_L("pos longitude=%f"), pos.Longitude());
INFO_PRINTF2(_L("pos datum=0x%x"), pos.Datum());
INFO_PRINTF2(_L("pos horAccuracy=%f"), pos.HorizontalAccuracy());
INFO_PRINTF2(_L("pos verAccuracy=%f"), pos.VerticalAccuracy());
TRAP_IGNORE(pos.Time().FormatL(cTimeStr, KTimeFormat);)
示例2: PackPositionData
TInt CPositionRequest::PackPositionData()
{
TPositionInfo& info = PositionInfo(iPositionBuffer);
// Verify that ModuleId, set by PSY, is correct if using specific PSY.
// If a proxy PSY is used, the proxy is responsible for verifying UID.
if (!iHasProxyPositioner &&
info.ModuleId() != iPositionerParams.iImplementationUid)
{
return KErrGeneral;
}
// Check that datum type still is WGS84
TPosition position;
info.GetPosition(position);
if (position.Datum() != KPositionDatumWgs84)
{
return KErrNotSupported;
}
TPtr8 ptrToBuffer = iPositionBuffer->Des();
return Global::Write(iMessage, KParamPositionInfo, ptrToBuffer);
}
示例3: Compare_PosInfo
EXPORT_C TBool T_LbsUtils::Compare_PosInfo(const TPositionInfoBase& aPosInfoSideA, const TPositionInfoBase& aPosInfoSideB, TComparisonAccuracyType aCmpAccuracy)
{
// TODO compare base class items, such as module id, position mode, etc.
TUint32 typeA = aPosInfoSideA.PositionClassType();
TUint32 typeB = aPosInfoSideB.PositionClassType();
// Compare TPositionInfo type items.
if(typeA & typeB & EPositionInfoClass)
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Both positions are of type EPositionInfoClass");
const TPositionInfo& posInfoSideA = reinterpret_cast<const TPositionInfo&>(aPosInfoSideA);
const TPositionInfo& posInfoSideB = reinterpret_cast<const TPositionInfo&>(aPosInfoSideB);
TPosition posSideA;
TPosition posSideB;
posInfoSideA.GetPosition(posSideA);
posInfoSideB.GetPosition(posSideB);
// Carry out an exact check when comparing items.
if (EExactAccuracy == aCmpAccuracy)
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Comparing positions for exact match");
// Compare latitude.
if (Math::IsNaN(posSideA.Latitude()) && Math::IsNaN(posSideB.Latitude()))
;
else if (posSideA.Latitude() != posSideB.Latitude())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Latitudes %d and %d respectively", posSideA.Latitude(), posSideB.Latitude());
return EFalse;
}
// Compare longitude.
if (Math::IsNaN(posSideA.Longitude()) && Math::IsNaN(posSideB.Longitude()))
;
else if (posSideA.Longitude() != posSideB.Longitude())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Longitudes %d and %d respectively", posSideA.Longitude(), posSideB.Longitude());
return EFalse;
}
// Compare altitude.
if (Math::IsNaN(posSideA.Altitude()) && Math::IsNaN(posSideB.Altitude()))
;
else if (posSideA.Altitude() != posSideB.Altitude())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Altitudes %d and %d respectively", posSideA.Altitude(), posSideB.Altitude());
return EFalse;
}
// Compare datum.
if (posSideA.Datum() != posSideB.Datum())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Datums %d and %d respectively", posSideA.Datum(), posSideB.Datum());
return EFalse;
}
// Compare horizontal accuracy.
if (Math::IsNaN(posSideA.HorizontalAccuracy()) && Math::IsNaN(posSideB.HorizontalAccuracy()))
;
else if (posSideA.HorizontalAccuracy() != posSideB.HorizontalAccuracy())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Horizontal Accuracies %d and %d respectively", posSideA.HorizontalAccuracy(), posSideB.HorizontalAccuracy());
return EFalse;
}
// Compare vertical accuracy.
if (Math::IsNaN(posSideA.VerticalAccuracy()) && Math::IsNaN(posSideB.VerticalAccuracy()))
;
else if (posSideA.VerticalAccuracy() != posSideB.VerticalAccuracy())
{
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Positions don't match!");
TESTLOG3(ELogP1, "Vertical Accuracies %d and %d respectively", posSideA.VerticalAccuracy(), posSideB.VerticalAccuracy());
return EFalse;
}
}
else
{
// Check latitude + longitude using horz accuracy.
TReal horzAct = posSideA.HorizontalAccuracy(); // Use the verify accuracy value (which is side A).
TReal distance ;
TESTLOG(ELogP1, "T_LbsUtils::Compare_PosInfo() Comparing positions for 'rough' match");
// if(NAN != horzAct)
{
// The following is a temporary patch until TPositionInfo.Distance() is implemented:
/*
from http://www.movable-type.co.uk/scripts/GIS-FAQ-5.1.html
presuming a spherical Earth with radius R (see below), and the locations of the two points in spherical coordinates (longitude and latitude) are lon1,lat1 and lon2,lat2 then the
Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159):
dlon = lon2 - lon1
dlat = lat2 - lat1
//.........这里部分代码省略.........