logoSpatial Topology

IMDF 101

Introduction of creating IMDF files step by step

IMDF 格式介紹

IMDF(Indoor Mapping Data Format)是一種用於描述室內地圖的數據格式,由 Apple 在 2018 年推出。IMDF 通過描述室內空間的幾何形狀、層次結構、設施和其他信息,使開發者能夠創建基於室內地圖的應用程序。

格式中主要包含以下幾種檔案(目錄中的*代表該檔案不可缺少):

manifest.json
venue.geojson
address.geojson
building.geojson
footprint.geojson
level.geojson
unit.geojson
amenity.geojson
opening.geojson

manifest.json*

必要檔案,包含了 IMDF 檔案的基本資訊

manifest.json
{
  "version": "1.0.0",
  "created": "2024-10-08T02:36:23.828Z",
  "generated_by": "IMDF Sandbox 2020.09",
  "language": "zh-TW"
}

venue.geojson*

描述該場域的基本資訊以及在座標空間上的幾何形狀,透過 addess_id 與 address.geojson 做關聯

venue.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "dd59d986-251a-41c1-989e-bf35d4b66e33",
      "feature_type": "venue",
      "properties": {
        "category": "university",
        "restriction": null,
        "name": {
          "en": "National Yang Ming Chiao Tung University - Yangming Campus",
          "zh": "國立陽明交通大學 - 陽明校區"
        },
        "alt_name": {"en": "NYCU - Yangming Campus"},
        "hours": "Mo-Fr 09:00-17:00",
        "phone": "+886228267000",
        "website": "https://nycu.edu.tw/",
        "display_point": {
          "type": "Point",
          "coordinates": [121.5158815, 25.1228118]
        },
        "address_id": "b2c99096-281b-4d6e-b8c9-8042a264609b"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [121.5156356, 25.1226665],
            [121.5161813, 25.1226938],
            [121.5161582, 25.123056],
            [121.5158315, 25.1230426],
            [121.5158285, 25.1230844],
            [121.5155214, 25.123071],
            [121.5155368, 25.1227527],
            [121.5156309, 25.1227565],
            [121.5156356, 25.1226665]
          ]
        ]
      }
    }
  ]
}

address.geojson*

紀錄場域的地址資訊

address.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "8fe6c935-f94d-40d2-9cd6-1b897ae25615",
      "feature_type": "address",
      "properties": {
        "address": "No. 155, Sec. 2, Linong St., Beitou Dist., Taipei City 112304, Taiwan",
        "unit": null,
        "locality": "Taipei",
        "province": "TW-TPE",
        "country": "TW",
        "postal_code": "112304",
        "postal_code_ext": null,
        "postal_code_vanity": null
      },
      "geometry": null
    }
  ]
}

building.geojson*

紀錄場域中有哪些建築物,透過 address_id 與 address.geojson 做關聯,並且不包含幾何描述

building.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "02f9d41b-8b38-4b8b-a13c-5e5288248460",
      "feature_type": "building",
      "properties": {
        "name": {"en": "2nd Medical Building", "zh": "醫學二館"},
        "alt_name": null,
        "category": "unspecified",
        "restriction": null,
        "display_point": {
          "type": "Point",
          "coordinates": [121.5158815, 25.1228118]
        },
        "address_id": "b2c99096-281b-4d6e-b8c9-8042a264609b"
      },
      "geometry": null
    },
    {
      "type": "Feature",
      "id": "211ae662-0344-45af-aab7-bb0c35ff90e7",
      "feature_type": "building",
      "properties": {
        "name": {"en": "Yangming Campus Library", "zh": "陽明校區圖書館"},
        "alt_name": null,
        "category": "unspecified",
        "restriction": null,
        "display_point": {
          "type": "Point",
          "coordinates": [121.5134608, 25.1204507]
        },
        "address_id": "b2c99096-281b-4d6e-b8c9-8042a264609b"
      },
      "geometry": null
    }
  ]
}

footprint.geojson*

描述 building 在地面上 (ground) 、空中 (aerial) 甚至地下 (subterranean) 的投影

footprint.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "f329780b-9f38-4fa4-8d52-e00f766a6d1d",
      "feature_type": "footprint",
      "properties": {
        "category": "ground",
        "name": null,
        "building_ids": ["02f9d41b-8b38-4b8b-a13c-5e5288248460"]
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [121.5156948, 25.1227705],
            [121.5156815, 25.1227699],
            [121.5156484, 25.1227683],
            // ...
            [121.5157176, 25.1227716],
            [121.5157124, 25.1227713],
            [121.5156948, 25.1227705]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "id": "89c543cf-968a-4511-8760-760cb72134c6",
      "feature_type": "footprint",
      "properties": {
        "category": "aerial",
        "name": null,
        "building_ids": ["02f9d41b-8b38-4b8b-a13c-5e5288248460"]
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [121.5156482, 25.1227683],
            [121.5156499, 25.1227391],
            [121.5156501, 25.1227363],
            // ...
            [121.5156483, 25.1227684],
            [121.5156483, 25.1227683],
            [121.5156482, 25.1227683]
          ]
        ]
      }
    }
  ]
}

level.geojson*

描述各樓層的幾何形狀

level.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "2a59caed-8774-459a-8c4a-9b344530f52d",
      "feature_type": "level",
      "properties": {
        "category": "unspecified",
        "restriction": null,
        "outdoor": false,
        "ordinal": 0,
        "name": {"en": "1F"},
        "short_name": {"en": "1F"},
        "display_point": {
          "type": "Point",
          "coordinates": [121.5158815, 25.1228118]
        },
        "address_id": null,
        "building_ids": ["02f9d41b-8b38-4b8b-a13c-5e5288248460"]
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [121.5156948, 25.1227705],
            [121.5156815, 25.1227699],
            [121.5156484, 25.1227683],
            // ...
            [121.5157176, 25.1227716],
            [121.5157124, 25.1227713],
            [121.5156948, 25.1227705]
          ]
        ]
      }
    },
    // ...
  ]
}

units.geojson*

描述各樓層中房間、設施等的幾何形狀及位置

unit.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "1781b56b-0f31-47c7-ab06-e1dccdc5bc66",
      "feature_type": "unit",
      "properties": {
        "category": "room",
        "restriction": null,
        "accessibility": null,
        "name": {"en": "Electrical Substation Room", "zh": "變電機械"},
        "alt_name": null,
        "level_id": "2a59caed-8774-459a-8c4a-9b344530f52d",
        "display_point": {
          "type": "Point",
          "coordinates": [121.5157129, 25.1227997]
        }
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [121.5158181, 25.1228286],
            [121.5158037, 25.1228279],
            [121.5157679, 25.1228263],
            // ...
            [121.5158239, 25.1228288],
            [121.5158239, 25.1228289],
            [121.5158181, 25.1228286]
          ]
        ]
      }
    },
    // ...
  ]
}

amenity.geojson*

公共設施,例如 ATM 、資訊站、廁所等

amenity.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "6053fe47-eed3-4fdd-bb90-9dac2799749f",
      "feature_type": "amenity",
      "properties": {
        "category": "restroom.female",
        "accessibility": null,
        "name": {"en": "Female Restroom", "zh": "女廁"},
        "alt_name": null,
        "hours": null,
        "phone": null,
        "website": null,
        "unit_ids": ["5f9a3d0a-de6d-4e8d-ac60-37f600ba489f"],
        "address_id": null,
        "correlation_id": null
      },
      "geometry": {
        "type": "Point",
        "coordinates": [121.5161166, 25.1228218]
      }
    },
    // ...
  ]
}

opening.geojson*

出入口

opening.geojson
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "ef320e28-4013-4b68-ae8e-c056699ad0a4",
      "feature_type": "opening",
      "properties": {
        "category": "pedestrian",
        "accessibility": null,
        "access_control": null,
        "door": null,
        "name": null,
        "alt_name": null,
        "display_point": {
          "type": "Point",
          "coordinates": [121.5161219, 25.1227975]
        },
        "level_id": "2a59caed-8774-459a-8c4a-9b344530f52d"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [121.5161222, 25.1227907],
          [121.5161218, 25.1227985],
          [121.5161218, 25.1227987],
          [121.5161215, 25.1228032]
        ]
      }
    },
    {
      "type": "Feature",
      "id": "84f5d736-9fe4-457a-aee9-104627881394",
      "feature_type": "opening",
      "properties": {
        "category": "pedestrian",
        "accessibility": null,
        "access_control": null,
        "door": null,
        "name": null,
        "alt_name": null,
        "display_point": {
          "type": "Point",
          "coordinates": [121.5161205, 25.12282]
        },
        "level_id": "2a59caed-8774-459a-8c4a-9b344530f52d"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [121.5161208, 25.1228155],
          [121.5161203, 25.1228245]
        ]
      }
    },
    // ...
  ]
}

occupant.geojson

店家、私有設施等

relationship.geojson

描述各unit之間的關聯性

其他分類 geojson 在此先不贅述