現在、
Routes Preferred API は一部のお客様のみご利用いただけます。詳しくは、
営業担当者までお問い合わせください。
ポリラインの品質を設定する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ポリラインの品質は、次の用語で説明できます。
- ポリラインを構成するポイントの数
- ポイントの数が多いほど、ポリラインは滑らかになります(特にカーブで)。
- ポイントの浮動小数点精度
- ポイントは、単精度浮動小数点数形式で表される緯度と経度の値として指定します。これは小さい値に対してはうまく機能し、正確に表すことができますが、値が増加すると浮動小数点丸め誤差のために精度が低下します。
ポリラインの品質を指定する
ComputeRoutes()
メソッドを呼び出すときに、PolylineQuality
列挙値を使用してポリラインの品質を指定します。
最大数の点で構成されるポリラインを作成して、最高解像度のポリラインを作成する場合は、HIGH_QUALITY
値を使用します。品質の向上は、レスポンスのレイテンシの増加を伴います。
ルートの低解像度の概要(最小数の点で構成されるポリライン)を作成する場合は、OVERVIEW
値を使用します。このオプションを使用すると、レイテンシが最も低いレスポンスが生成されます。
例
次の例は、リクエスト本文でポリラインの品質を設定する方法を示しています。
{
"origin":{
"location":{
"latLng":{
"latitude":37.419734,
"longitude":-122.0827784
}
}
},
"destination":{
"location":{
"latLng":{
"latitude":37.417670,
"longitude":-122.079595
}
}
},
"polylineQuality":"HIGH_QUALITY"
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-04-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-04-25 UTC。"],[[["Polyline quality is determined by the number of points and their floating-point precision, impacting smoothness and accuracy."],["`HIGH_QUALITY` setting yields the most detailed polyline with maximum points, potentially increasing response time."],["`OVERVIEW` setting creates a simplified polyline with minimal points, prioritizing faster response."],["You can adjust the polyline quality using the `PolylineQuality` enumeration when making API requests, as shown in the example."]]],["Polyline quality depends on the number of points and their floating-point precision. The `ComputeRoutes()` method uses `PolylineQuality` to set this. `HIGH_QUALITY` creates a polyline with the maximum points, resulting in high resolution but increased latency. `OVERVIEW` generates a low-resolution polyline with minimal points, reducing latency. The request body sets `polylineQuality` to specify either `HIGH_QUALITY` or `OVERVIEW`, which will influence the polyline's precision.\n"]]