NGSI Entity2poi operator は、NGSI エンティティ (NGSI source operator からのエンティティ) を Point of Interest に変換します。このため、エンティティに座標を含む属性を含める必要があります。また、このオペレータが汎用であるという点を考慮してください。したがって、このオペレータによって作成された PoI のマーカーは、属性/値のペアの単なる合成になります。
ワイヤリング
入出力データ
Point 入力データ
1 2 3 4 5 6 7 8 9 10 11 |
{ "id": "point001", "type": "point", "location": { "type": "Point", "coordinates": [ 139.7729, 35.698225 ] } } |
Point 出力データ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[ { "id": "point001", "icon": "https://wirecloud/showcase/media/CoNWeT/ngsientity2poi/3.2.0/images/icon.png", "tooltip": "point001", "data": { "id": "point001", "type": "point", "location": { "type": "Point", "coordinates": [ 139.7729, 35.698225 ] } }, "infoWindow": "<div><span style=\"font-size:12px;\"><b>id: </b> point001</span><br /><span style=\"font-size:12px;\"><b>type: </b> point</span><br /><span style=\"font-size:12px;\"><b>location: </b> {\n \"type\": \"Point\",\n \"coordinates\": [\n 139.7729,\n 35.698225\n ]\n}</span><br /></div>", "location": { "type": "Point", "coordinates": [ 139.7729, 35.698225 ] } } ] |
Line 入力データ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
{ "id": "line001", "type": "line", "location": { "type": "LineString", "coordinates": [ [ 139.702629, 35.671282 ], [ 139.701519, 35.65795 ], [ 139.709852, 35.646562 ] ] } } |
Line 出力データ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[ { "id": "line001", "icon": "https://wirecloud/showcase/media/CoNWeT/ngsientity2poi/3.2.0/images/icon.png", "tooltip": "line001", "data": { "id": "line001", "type": "line", "location": { "type": "LineString", "coordinates": [ [ 139.702629, 35.671282 ], [ 139.701519, 35.65795 ], [ 139.709852, 35.646562 ] ] } }, "infoWindow": " |
id: line001
type: line
location: {\n \”type\”: \”LineString\”,\n \”coordinates\”: [\n [\n 139.702629,\n 35.671282\n ],\n [\n 139.701519,\n 35.65795\n ],\n [\n 139.709852,\n 35.646562\n ]\n ]\n}
type: line
location: {\n \”type\”: \”LineString\”,\n \”coordinates\”: [\n [\n 139.702629,\n 35.671282\n ],\n [\n 139.701519,\n 35.65795\n ],\n [\n 139.709852,\n 35.646562\n ]\n ]\n}
“, “location”: { “type”: “LineString”, “coordinates”: [ [ 139.702629, 35.671282 ], [ 139.701519, 35.65795 ], [ 139.709852, 35.646562 ] ] } } ]
Polygon 入力データ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
{ "id": "polygon001", "type": "polygon", "location": { "type": "Polygon", "coordinates": [ [ [ 139.692144, 35.689913 ], [ 139.741369, 35.658161 ], [ 139.767168, 35.681489 ], [ 139.692144, 35.689913 ] ] ] } } |
Polygon 出力データ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
[ { "id": "polygon001", "icon": "https://wirecloud/showcase/media/CoNWeT/ngsientity2poi/3.2.0/images/icon.png", "tooltip": "polygon001", "data": { "id": "polygon001", "type": "polygon", "location": { "type": "Polygon", "coordinates": [ [ [ 139.692144, 35.689913 ], [ 139.741369, 35.658161 ], [ 139.767168, 35.681489 ], [ 139.692144, 35.689913 ] ] ] } }, "infoWindow": "<div><span style=\"font-size:12px;\"><b>id: </b> polygon001</span><br /><span style=\"font-size:12px;\"><b>type: </b> polygon</span><br /><span style=\"font-size:12px;\"><b>location: </b> {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 139.692144,\n 35.689913\n ],\n [\n 139.741369,\n 35.658161\n ],\n [\n 139.767168,\n 35.681489\n ],\n [\n 139.692144,\n 35.689913\n ]\n ]\n ]\n}</span><br /></div>", "location": { "type": "Polygon", "coordinates": [ [ [ 139.692144, 35.689913 ], [ 139.741369, 35.658161 ], [ 139.767168, 35.681489 ], [ 139.692144, 35.689913 ] ] ] } } ] |
OpenLayers Map とのワイヤリング例
ワイヤリング
入力例
出力例
サンプルデータ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#!/bin/sh curl "http://orion/v2/op/update" -D - -sS \ -H 'Content-Type: application/json' \ -H 'Fiware-Service: wirecloud' \ -H 'Fiware-ServicePath: /data' \ -d @- <<EOF { "actionType": "append", "entities": [ { "id": "point001", "type": "point", "location": { "type": "geo:json", "value": { "type": "Point", "coordinates": [ 139.772900, 35.698225 ] } } }, { "id": "line001", "type": "line", "location": { "type": "geo:json", "value": { "type": "LineString", "coordinates": [ [ 139.702629, 35.671282 ], [ 139.701519, 35.657950 ], [ 139.709852, 35.646562 ] ] } } }, { "id": "polygon001", "type": "polygon", "location": { "type": "geo:json", "value": { "type": "Polygon", "coordinates": [ [ [ 139.692144, 35.689913 ], [ 139.741369, 35.658161 ], [ 139.767168, 35.681489 ], [ 139.692144, 35.689913 ] ] ] } } } ] } EOF |
関連情報
https://github.com/wirecloud-fiware/ngsi-entity2poi-operator
WireCloud widget and operatorWireCloud では、ウィジェットとオペレータと呼ばれる機能部品を組み合わせることで、Web アプリケーションやダッシュボードを作成...