Skip to content

JSON format

Hyemi Jeong edited this page Jul 13, 2018 · 17 revisions

User can send their data to the RESTful server of InFactory in JSON format. All the elements in IndoorGML can be expressed by JSON. This JSON formats describe the complex features of IndoorGML.

Before create the features

You need to create the document firstly by sending this form to the server.

{
   "docId" : "", // which document contains this elements
   "type" : "", // which type of IndoorGML complex feature
   "id" : "",  // identifier of IndoorGML
   "parentId" : ""  // the identifier of the element which has the association relationship with this element.
}

InFactory supports the unordered creating of the features. Because InFactory only checkes whether all needed features exist or not when InFactory receive "GET" request from the client. So After creating Document, you can freely create the elements.

JSON formats of the complex features of IndoorGML

IndoorFeatures


{
   “type" : "IndoorFeatures",
   “id" : “if1",
   “docId" : “doc1",
   “properties" : {
      "name" : "indoorfeatures1",
      "description": “blah blah blah",
      "primalspacefeatures" : "psf1",
      "multilayeredgraph" : "mlg1"
   }
}

PrimalSpaceFeatures


{
   “type" : "PrimalSpaceFeatures",
   “id" : “psf1",
   “docId" : “doc1",
   “properties" : {
      "name" : "indoorfeatures1",
      "description": “blah blah blah",
      "cellSpaceMember" : ["c1","c2"],
      "cellSpaceBoundaryMember" : ["cb1", "cb2"]
   }
}

MultiLayeredGraph


{
   “type" : "IndoorFeatures",
   “id" : “if1",
   “docId" : “doc1",
   “properties" : {
      "name" : "indoorfeatures1",
      "description": “blah blah blah",
      "spaceLayers" : "sls1",
      "interEdges" : "ie1"
   }
}

CellSpace


{
   “type" : "CellSpace",
   “id" : “c1",
   “parentId" : “psf1",
   “docId" : “doc1",
   “geometry" : {
      “type" : “Solid|Surface",
      “coordinates" : [] | “wkt",
      “properties" : {
         “id" : “cg1",
         “extrude" : “true|false",
         “height" : “1",
      }
   },
   “properties" : {
      “name" : “cell1",
      “description": “blah blah blah",
      “partialboundedBy" : [“cb1", “cb2","cb3"]
   }
}

CellSpaceBoundary

{
    “type" : “CellSpaceBoundary",
    “id" : “csb1",
    “parentId" : “psf1",
    “docId" : “doc1",
    “geometry" : {
        “type" : “Surface|LineString",
         “coordinates" : [],
         “properties" : {
         “id" : “cgb1",
         “extrude" : “true|false",
         “height" : “value1" //the height of the door
       }
    },
    “properties" : {
        “name" : “CellBoundary1",
        “description" : “cellspaceboundary of cell1"
        “duality" : “T1",       
    }
}

SpaceLayers


{
   “type" : "SpaceLayers",
   “id" : “sls1",
   “docId" : “doc1",
   “parentId" : “mlg1",
   “properties" : {
      "name" : "spacelayers1",
      "description": “blah blah blah",
      "spaceLayerMember" : ["sl1"]
   }
}

SpaceLayer


{
   “type" : "SpaceLayer",
   “id" : “sl1",
   “docId" : “doc1",
   “parentId" : “sls1",
   “properties" : {
      "name" : "indoorfeatures1",
      "description": “blah blah blah",
      "nodes" : ["n1"],
      "edges" : ["e1"]
   }
}

Nodes


{
   “type" : "Nodes",
   “id" : “n1",
   “docId" : “doc1",
   “parentId" : “sl1",
   “properties" : {
      "name" : "nodes1",
      "description": “blah blah blah",
      "stateMember" : ["s1","s2"]      
   }
}

Edges


{
   “type" : "Edges",
   “id" : “e1",
   “docId" : “doc1",
   “parentId" : “sl1",
   “properties" : {
      "name" : "Edges1",
      "description": “blah blah blah",
      "transitionMember" : ["t1"]
   }
}

State

{
   “type":"State",
   “id" : “s1",
   “parentId" : “n1",
   “docId" : “doc1",
   “geometry" : {
      “type" : “Point",
      “coordinates" : [],
      “properties" : {
         “id" : “sg1"
      }
   },
   “properties" : {
      “name" : “s1",
      “description" : “state",
      “duality" : “c1",
      “connects" : [“t1"]
   }
}

Transition

{
   “type" : “Transition",
   “id" : “t1",
   “parentId" : “e1",
   “geometry" : {
      “type" : “LineString",
      “coordinates" : [],
      “properties" : {
         “id" : “tg1"
      }
   },
   “properties" : {
      “weight" : “0",
      “connects" : ["s1","s2"],
      “duality" : “csb1"
   }
}

Clone this wiki locally