GPS ポイントをインデックスと共に保存しています。この質問でこれらのポイントを参照するには、GPS[0]、GPS[1] のようになります。ここで、GPS は GPS の位置、[n] はインデックスです。 GPS 位置の配列。
場所を保存する方法は次のとおりです (この例では、配列には 11 の場所しか含まれていません)。
GPS[0] = 道路の始点 - 常に最初のインデックス
GPS[10] = 道路の終わり - 常に最後のインデックス
GPS[ 1 - 9 ] = 道路の始点と終点の間のポイント
注: [1 - 9] ポイントのすべてが同時にキャプチャされるわけではありません。たとえば、GPS[1] と GPS[2] は月曜日にキャプチャされ、GPS[3] は水曜日と GPS[4 - 9] にキャプチャされる場合があります1 か月後にキャプチャされる可能性があります。それらがキャプチャされない場合...それらは無視されます。
さらに、GPS 位置が「順不同」にキャプチャされる場合があります...「順不同」とは、ポイントが道路に沿ってキャプチャされることを意味しますが、必ずしも旅行中に遭遇する順序と同じであるとは限りません。最初から最後まで道を下ります。
これは私のアルゴリズムの質問に私を導きます:
(「MAP API」は、マッピング API を持つ任意のソフトウェア/サービスであることに注意してください)
//--- is there a MAP API that does this?
Set CurrentPoint = MAP.api.FindPoint( GPSArray[0] )
//--- is there a MAP API that does this?
Set EndPoint = MAP.api.FindPoint( GPSArray[10] )
List<int> sequencedIndicies = new List<int>;
while ( CurrentPoint != EndPoint )
{
// Is there a MAP API that will travel down the road from the current point
// X feet and set the current point to that location ?
CurrentPoint = MAP.api.TravelThisManyFeetDownRoad( CurrentPoint, 100 )
// loop through my points and check them against the current road point
for( int i= 1; i<10; i++ )
{
// Is there a MAP API function will take a point, a "current" point
// and tell if the point is within X feet of the current point
//
// ( alternatively I could use Haversine function if map api does not exist )
//
if( MAP.api.IsNear( CurrentPoint, GPSArray[i], 50 ) ) <--- need this too
{
sequencedIndicies.Add( i );
break;
}
}
}
// move the GPS points to the new sequenced order
ReindexGPSArray( GPSArray, sequenceIndicies )
MAP API 機能を扱う C# サンプル コードを探しています。
別のメモ...これには、ユーザーインターフェイスの表示は必要ありません...
緯度/経度を使用できます...ただし、使用する GPS 座標はそれほど重要ではありません...重要なのは、道路を移動して、ポイントが現在のポイントに近いかどうかを判断できる MAP API 機能です。 .
ありがとう