Amazon OpenSearch Service를 사용한 공간 검색 및 QGIS에서 시각화
44773 단어 opensearchqgisawsgis

Amazon OpenSearch Service로 공간 탐색을 시도하고 QGIS로 시각화했습니다 🎉
다음은 자세한 설명입니다.
사전 준비
Amazon OpenSearch Service에서 사용할 GIS 데이터를 준비합니다. 이번에는 미리 OpenStreetMap에 QGIS 데이터 샘플을 준비했습니다.
GeoJSON에서 포인트의 GIS 데이터를 준비한 다음 가져올 수 있도록 GeoJSON을 JSON으로 사전 수정했습니다.

이 샘플 데이터는 GitHub에 등록해 두었으니 마음껏 사용해주세요.
https://github.com/dayjournal/data/tree/main/try-092
이제 예비 GIS 데이터로 모든 설정이 완료되었습니다!
도메인 만들기
Amazon OpenSearch Service에서 도메인을 생성하는 방법입니다.
AWS Management Console → Amazon OpenSearch Service를 클릭합니다.

"도메인 만들기"를 클릭합니다.

도메인 이름, 배포 유형 및 자동 조정을 설정합니다.

데이터 노드와 전용 마스터 노드를 설정합니다.

네트워크, 세분화된 액세스 제어 및 액세스 정책을 구성합니다.
사용자를 생성하려면 사용자 이름과 암호를 입력하십시오.
네트워크는 이 데모를 위해 공개 액세스로 설정되었습니다.

암호화 설정 → "만들기"를 클릭합니다.

잠시만 기다리면 환경 구축이 완료됩니다.

이제 도메인 생성이 완료되었습니다!
OpenSearch 대시보드에 연결
Amazon OpenSearch Service를 사용하여 OpenSearch 대시보드에 연결하는 방법입니다.
OpenSearch 대시보드 URL을 클릭합니다.

도메인을 만들 때 설정한 사용자 이름과 비밀번호를 입력 → "로그인"을 클릭합니다.

OpenSearch 대시보드에 연결됩니다.

이제 OpenSearch 대시보드에 연결되었습니다!
위치정보 등록
Amazon OpenSearch Service에 위치 데이터를 등록하는 방법입니다.
OpenSearch 대시보드에 연결 → "개발 도구"를 클릭합니다.

위치 데이터의 인덱스를 설정합니다. 이 경우에는 "geo_shape"를 사용했습니다.
PUT point_geo_sample
{
"mappings": {
"properties": {
"geometry": {
"type": "geo_shape"
}
}
}
}

위치 데이터를 가져옵니다. 원본 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": {}}
....

이것으로 위치 정보 등록이 완료되었습니다!
공간 검색
마지막으로 Amazon OpenSearch Service를 사용하여 공간 검색을 수행하는 방법을 보여줍니다.
이 공간 검색을 위해 아래와 같이 bbox에서 포인트 데이터를 검색합니다. 사전에 QGIS에서 데이터를 시각화하고 검색하려는 왼쪽 상단과 오른쪽 하단 지점의 위도와 경도를 준비하십시오.

공간 검색 조건을 지정하고 왼쪽 상단과 오른쪽 하단의 위도와 경도를 입력합니다.
POST point_geo_sample/_search
{
"query":{
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"geometry": {
"shape": {
"type": "envelope",
"coordinates" : [[139.7802, 35.6781], [139.7878, 35.6724]]
},
"relation": "within"
}
}
}
}
}
}
검색 결과는 QGIS 시각화와 일치했습니다!
{
"took" : 9,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 3,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "point_geo_sample",
"_type" : "_doc",
"_id" : "mdQ_54EBMGUV534vZahT",
"_score" : 1.0,
"_source" : {
"type" : "Feature",
"properties" : {
"full_id" : "n1892534950",
"name" : "セブン-イレブン",
"shop" : "convenience"
},
"geometry" : {
"type" : "Point",
"coordinates" : [
139.7819038,
35.675297
]
}
}
},
{
"_index" : "point_geo_sample",
"_type" : "_doc",
"_id" : "yNQ_54EBMGUV534vZa1Z",
"_score" : 1.0,
"_source" : {
"type" : "Feature",
"properties" : {
"full_id" : "n3758524951",
"name" : "セブン-イレブン",
"shop" : "convenience"
},
"geometry" : {
"type" : "Point",
"coordinates" : [
139.7859394,
35.6769875
]
}
}
},
{
"_index" : "point_geo_sample",
"_type" : "_doc",
"_id" : "KtQ_54EBMGUV534vZadN",
"_score" : 1.0,
"_source" : {
"type" : "Feature",
"properties" : {
"full_id" : "n1215847202",
"name" : "NATURAL LAWSON",
"shop" : "convenience"
},
"geometry" : {
"type" : "Point",
"coordinates" : [
139.781879,
35.6744447
]
}
}
}
]
}
}

Amazon OpenSearch Service를 사용하면 가져온 데이터를 공간적으로 검색할 수 있습니다!
관련 기사


Amazon Athena를 사용한 Amazon S3 데이터의 공간 검색 및 QGIS에서 시각화
Yasunori Kirimoto for AWS Community Builders ・ 5월 16일 ・ 4분 읽기
#athena
#s3
#qgis
#aws


Amazon Redshift 및 DBeaver를 사용한 공간 검색
AWS Community Builders용 Yasunori Kirimoto ・ 2021년 12월 3일 ・ 4분 읽기
#aws
#redshift
#dbeaver
#qgis


QGIS와 Amazon Aurora PostgreSQL 및 PostGIS를 사용하여 위치 데이터 표시
AWS Community Builders용 Yasunori Kirimoto ・ 2021년 11월 3일 ・ 3분 읽기
#amazonaurora
#postgis
#qgis
#foss4g
참조
Amazon OpenSearch Service
QGIS
Reference
이 문제에 관하여(Amazon OpenSearch Service를 사용한 공간 검색 및 QGIS에서 시각화), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/aws-heroes/spatial-search-with-amazon-opensearch-service-and-visualized-it-in-qgis-2m70텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)