dayjournal memo

Total 975 articles!!

Amazon OpenSearch Service #003 - 位置情報データ登録

Yasunori Kirimoto's avatar

img



Amazon OpenSearch Serviceで位置情報データを登録するメモ。



事前準備

  • GISデータを準備
    今回のサンプルデータをGitHubに登録したのでぜひご利用ください。
    sample data

img


OpenSearch Dashboardsに接続 →「Dev Tools」をクリック。

img


位置情報データ用のインデックスを設定。今回は「geo_shape」を利用しました。

PUT point_geo_sample
{
  "mappings": {
        "properties": {
            "geometry": {
                "type": "geo_shape"
            }
        }
  }
}

img


位置情報データをインポート。元データのGeoJSONをインポート用のJSONに事前修正してあります。

POST point_geo_sample/_bulk
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n260423690", "name": "文教堂書店", "shop": "books" }, "geometry": { "type": "Point", "coordinates": [ 139.7577071, 35.6678306 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n260424181", "name": "LABI", "shop": "electric" }, "geometry": { "type": "Point", "coordinates": [ 139.757034800000014, 35.6671262 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n260424208", "name": "キムラヤ", "shop": "electric" }, "geometry": { "type": "Point", "coordinates": [ 139.7577643, 35.665613 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n261024380", "name": "ソフトバンクショップ", "shop": "mobile_phone" }, "geometry": { "type": "Point", "coordinates": [ 139.7773429, 35.6772184 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n410500414", "name": "ミニストップ", "shop": "convenience" }, "geometry": { "type": "Point", "coordinates": [ 139.745115, 35.7081941 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n417434047", "name": "Inplexe", "shop": "accessories" }, "geometry": { "type": "Point", "coordinates": [ 139.7414085, 35.7005685 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n439115834", "name": "フォルクスワーゲン六本木", "shop": "car" }, "geometry": { "type": "Point", "coordinates": [ 139.7359042, 35.665522 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n474605269", "name": "Family Mart", "shop": "convenience" }, "geometry": { "type": "Point", "coordinates": [ 139.7499649, 35.6692143 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n474605283", "name": "セブン-イレブン", "shop": "convenience" }, "geometry": { "type": "Point", "coordinates": [ 139.7540003, 35.668082 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n474605289", "name": "Lawson", "shop": "convenience" }, "geometry": { "type": "Point", "coordinates": [ 139.754741599999988, 35.6676069 ] } }
{"index": {}}
{ "type": "Feature", "properties": { "full_id": "n559359769", "name": "LAWSON 銀座6丁目店", "shop": "convenience" }, "geometry": { "type": "Point", "coordinates": [ 139.7657173, 35.6687584 ] } }
{"index": {}}
....

img




book

Q&A