フィーチャーを操作します
ID でスペース内のフィーチャーを読み取ります
次のリクエストは、機能の ID を使用して単一の機能をクエリーします。
リクエスト
Swagger で試してください
GET /spaces/{spaceId}/features/{featureId}
応答
{
"type": "Feature",
"id": "{featureId}",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"name": "Anfield",
"@ns:com:here:xyz":
{
"tags":
[
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
スペースのフィーチャーを読み取ります
スペース内の複数のフィーチャーを照会するには、次の要求を使用します。
リクエスト
Swagger で試してください
GET /spaces/[spaceId}/features?id={featureId1},{featureId2},{featureId3}
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"@ns:com:here:xyz":
{
"tags":
[
"football",
"stadium"
]
},
"name": "Anfield",
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
Feature Count およびその他の統計情報を取得します
HERE は、スペース内のフィーチャ数、サイズ、およびスペース内のタグのリストを取得する例です。
リクエスト
Swagger で試してください
GET /spaces/{spaceId}/statistics
応答
{
"type": "StatisticsResponse",
"count": {
"value": 29208,
"estimated": true
},
"byteSize": {
"value": 108364,
"estimated": true
},
"bbox": {
"value": [
-10,
-10,
10,
10
],
"estimated": true
},
"geometryTypes": {
"value": [
"Point"
],
"estimated": true
},
"properties": {
"value": [
{
"key": "Route",
"count": 29208,
"searchable": true
},
{
"key": "Route Type",
"count": 29208,
"searchable": true
}
],
"estimated": true,
"searchable": "PARTIAL"
},
"tags": {
"value": [
{
"key": "PuneBusStop",
"count": 29208
}
]
}
}
フィーチャーを作成 / 置換します
スペース内にフィーチャーを作成したり、既存のフィーチャーを置換したりするには、次のリクエストを使用できます。
警告
この PUT リクエストを使用すると、既存の機能が完全に消去されます。
既存の機能を保持するには 、このリクエストを使用します。
リクエスト
Swagger で試してください
PUT /spaces/{spaceId}/features
次のボディーを使用します
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"@ns:com:here:xyz":
{
"tags":
[
"football",
"stadium"
]
},
"name": "Anfield",
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"id": "BfiimUxHjj",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"name": "Anfield",
"@ns:com:here:xyz":
{
"createdAt": 1517504700726,
"updatedAt": 1517504700726,
"space": "x-demospace",
"tags":
[
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
フィーチャーを修正します
これは、 POST リクエスト を使用して既存のフィーチャーを修正する例です。
リクエスト
Swagger で試してください
POST /spaces/{spaceId}/features
次のボディーを使用します
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"@ns:com:here:xyz":
{
"tags":
[
"football",
"stadium"
]
},
"name": "Anfield",
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"id": "BfiimUxHjj",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"name": "Anfield",
"@ns:com:here:xyz":
{
"createdAt": 1517504700726,
"updatedAt": 1517504700726,
"space": "x-demospace",
"tags":
[
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
スペース内のフィーチャーを部分的に更新します
このリクエストには、追加、更新、または削除する機能のプロパティのみが含まれています。
- プロパティが最新バージョンのフィーチャーにまだ存在しない場合は、追加されます。
- プロパティに最新バージョンのフィーチャーの別の値が含まれている場合、その値はリクエストの値に更新されます
- リクエストのプロパティ値が null の場合、プロパティはフィーチャオブジェクトから削除されます
リクエスト
Swagger で試してください
PATCH /spaces/{spaceId}/features?id={featureId1},{featureId2},{featureId3}
パッチリクエストには、次のような内容が必要です
{
"type": "Feature",
"id": "string",
"geometry":
{
"type": "string"
},
"properties":
{
"@ns:com:here:xyz":
{}
},
"bbox":
[
-100.1,
-1.1,
100.1,
1.1
]
}
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"id": "BfiimUxHjj",
"geometry": {
"type": "Point",
"coordinates": [
-2.960847,
53.430828
]
},
"properties": {
"name": "Anfield",
"@ns:com:here:xyz": {
"createdAt": 1517504700726,
"updatedAt": 1517504700726,
"space": "x-demospace",
"tags": [
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
検証エラー
検証機能を使用している場合、次のような機能のアップロードまたは変更時にエラーメッセージが表示されることがあります。
{
"type": "FeatureCollection",
...
"features": [],
"failed": [
{
"id": null,
"position": 0,
"message": "Feature on position 0 has JSON schema validations errors/warnings.\n[[1,151][/properties] The object must have a property whose name is \"city\"., [1,151][/properties] The object must have a property whose name is \"employees\"., [1,151][/properties] The object must have a property whose name is \"name\"., [1,151][/properties] The object must have a property whose name is \"country\".]"
}
]
}
失敗 したプロパティには、スキーマの検証によって拒否されたすべての機能が含まれています。
ID は送信した ID です。 送信しなかった場合、 ID は例のようにヌルになります。
position は、アップロードされたフィーチャコレクション内の位置(ゼロを基点とした位置)です。
このメッセージ には、スキーマ検証エラーと、スキーマに確認されなかった内容の詳細な説明が含まれています。
スペースでフィーチャーを検索します
スペースを検索するには、 2 つの方法があります。 /search は 1 つ で、もう 1 つは /iterate です。 検索結果の順序は変更されません。また、検索を続行することもできません。
リクエスト
Swagger で試してください
GET /spaces/{spaceId}/search
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"id": "BfiimUxHjj",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"name": "Anfield",
"@ns:com:here:xyz":
{
"createdAt": 1517504700726,
"updatedAt": 1517504700726,
"space": "x-demospace",
"tags":
[
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
特定のスペースからフィーチャーを反復します
これは、スペースを検索する 2 番目の方法 です ( もう 1 つは /search ) 。 [ 反復処理 ] を使用すると、ハンドル が クエリ パラメーターであるすべての一致するフィーチャについて反復処理を行うことができます
リクエスト
Swagger で試してください
GET /spaces/{spaceId}/iterate
応答
{
"type": "FeatureCollection",
"features":
[
{
"type": "Feature",
"id": "BfiimUxHjj",
"geometry":
{
"type": "Point",
"coordinates":
[
-2.960847,
53.430828
]
},
"properties":
{
"name": "Anfield",
"@ns:com:here:xyz":
{
"createdAt": 1517504700726,
"updatedAt": 1517504700726,
"space": "x-demospace",
"tags":
[
"football",
"stadium"
]
},
"amenity": "Football Stadium",
"capacity": 54074,
"popupContent": "Home of Liverpool Football Club"
}
}
]
}
複数のフィーチャーを削除します
このリクエストに機能 ID を付けて送信することで、特定の機能を削除できます
リクエスト
Swagger で試してください
DELETE /spaces/{spaceId}/features?id={id1},{id2}
応答
HTTP/1.1 204 No Content