Skip to main content

Join attributes by location

ProcessId : 2142ccad46a21053de2f8fa9

Join attributes by location เป็นเครื่องมือสำหรับเชื่อมข้อมูลตารางของข้อมูลที่มีการ Intersec กันและมีการใช้ข้อมูล 2 ส่วน คือข้อมูล Input และข้อมูล Overlay ผลลัพธ์จะได้ข้อมูลคุณสมบัติ (Features) ของข้อมูล Input ข้อมูลในตารางจะเพิ่มข้อมูลของ Overlay เข้ามาด้วย

วิธีการใช้งาน

Input

  • Input : ระบุข้อมูลที่ต้องการนำมาเชื่อมข้อมูลตาราง โดยจะเป็นข้อมูลประเภท Vector (Point, Line, Polygon) ซึ่งสามารถนำ Features Collection ที่เคยนำเข้ามาแล้วมาสร้างและสามารถนำข้อมูล GeoJSON มาใช้ในการสร้างได้
  • Overlay ระบุข้อมูลที่ต้องการนำมาเชื่อมข้อมูลตารางที่นำมา Join กับข้อมูลในส่วนของ Input โดยข้อมูลในส่วน Ovelay ต้องเป็นข้อมูลที่อยู่ในรูปแบบ Polygon เท่านั้น

Parameter

  • Geometric predicate เลือกรูปแบบของการของการซ้อนทับกับของข้อมูล

     0 = intersects          3 = touches 
    1 = contains 4 = overlaps
    2 = equals 5 = within
  • Fields to add กำหนด field ที่ต้องการเชื่อมข้อมูลตารางได้ หากไม่ระบุจะใช้ทุก Field ในการเชื่อมต่อ

  • Join type เลือกรูปแบบของการเชื่อมตารางได้

    0 = one-to-many           2 = largest overlap only (one-to-one),
    1 = one-to-one 3 = largest overlap only (one-to-one)

Result ทำการเลือกประเภทของผลลัพธ์ซึ่งมีอยู่ 2 ประเภท คือ Vallaris Feature GeoJSON

  • Vallaris Feature จะต้องทำการสร้าง Features Collection ไว้สำหรับเก็บข้อมูลผลลัพธ์
  • GeoJSON จะได้ผลลัพธ์ออกมาเป็น GeoJSON

ภาพตัวอย่างข้อมูล Input เป็นข้อมูลประเภทจุดและข้อมูล Overlay เป็นข้อมูลประเภท Polygon
จะเห็นได้ว่าตัวอย่างผลลัพธ์ที่ฟิลด์ "data_2" ของในแต่จุดอ้างอิงตามตำแหน่งของจุดที่อยู่ใน Polygon

ตัวอย่างข้อมูล GeoJSON : Input
input.geojson
{
"type": "FeatureCollection",
"name": "point",
"features": [
{
"type": "Feature",
"properties": {
"data": 2
},
"geometry": {
"type": "Point",
"coordinates": [
99.68027451261905,
14.0803602942941
]
}
},
{
"type": "Feature",
"properties": {
"data": 4
},
"geometry": {
"type": "Point",
"coordinates": [
100.56322044876401,
13.805271610671046
]
}
},
{
"type": "Feature",
"properties": {
"data": 5
},
"geometry": {
"type": "Point",
"coordinates": [
102.01852832341501,
13.840766924686925
]
}
},
{
"type": "Feature",
"properties": {
"data": 3
},
"geometry": {
"type": "Point",
"coordinates": [
101.37517575687723,
14.240089207365552
]
}
}
]
}
ตัวอย่างข้อมูล GeoJSON : Overlay
overlay.geojson
{
"type": "FeatureCollection",
"name": "example_polygon",
"features": [
{
"type": "Feature",
"properties": {
"data": 20
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
100.97645526256841,
14.52848863374456
],
[
100.96403261172851,
13.177525354906454
],
[
99.21883543041264,
13.179666701141198
],
[
99.23658308742057,
14.52848863374456
],
[
100.97645526256841,
14.52848863374456
]
]
]
]
}
},
{
"type": "Feature",
"properties": {
"data": 10
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
100.96403261172851,
13.177525354906454
],
[
100.97645526256841,
14.52848863374456
],
[
102.84379437428417,
14.52848863374456
],
[
102.83492054578021,
13.175229786889213
],
[
100.96403261172851,
13.177525354906454
]
]
]
]
}
}
]
}
ตัวอย่างข้อมูล GeoJSON : Result
result.geojson
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"data": 2,
"data_2": 20
},
"geometry": {
"type": "Point",
"coordinates": [
99.68027451261905,
14.0803602942941
]
}
},
{
"type": "Feature",
"properties": {
"data": 4,
"data_2": 20
},
"geometry": {
"type": "Point",
"coordinates": [
100.56322044876401,
13.805271610671046
]
}
},
{
"type": "Feature",
"properties": {
"data": 5,
"data_2": 10
},
"geometry": {
"type": "Point",
"coordinates": [
102.01852832341501,
13.840766924686925
]
}
},
{
"type": "Feature",
"properties": {
"data": 3,
"data_2": 10
},
"geometry": {
"type": "Point",
"coordinates": [
101.37517575687723,
14.240089207365552
]
}
}
]
}