Skip to content

JSON format

Dohun Kang edited this page May 26, 2020 · 17 revisions

The data of users is sent 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. 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.

The complex features of IndoorGML

IndoorFeatures


{
   “type" : "IndoorFeatures", // describe the type of the class
   “id" : “if1", // the identifier of the feature
   “docId" : “doc1", // the document id where the feature exists  
   “properties" : { // the attributes of the feature will be placed
      "name" : "indoorfeatures1", // the name of this feature
      "description": “blah blah blah", // the description of this feature
      "primalspacefeatures" : "psf1", // the attribute named 'primalSpaceFeatures' - the identifier which this feature refers to
      "multilayeredgraph" : "mlg1" // the attribute named 'multiLayeredGraph' - the identifier which this feature refers to
   }
}

PrimalSpaceFeatures


{
   “type" : "PrimalSpaceFeatures",
   “id" : “psf1",
   “docId" : “doc1",
   “properties" : {
      "name" : "indoorfeatures1",
      "description": “blah blah blah",
      "cellSpaceMember" : ["c1","c2"],
      // the attribute named 'cellSpaceMember'
      // - the array of the identifiers of the CellSpace features
      // which this feature refers to
      "cellSpaceBoundaryMember" : ["cb1", "cb2"]
      // the attribute named 'cellSpaceBoundaryMember'
      // - the array of the identifiers of the CellSpaceBoundary features
      // which this feature refers to
   }
}

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" : {
     // the data of the attribute 'cellspaceGeometry' will be described at here
     // the type of the geometry
      “type" : “Solid|Surface",
      “coordinates" : [] | “wkt",
    // the data of the geometry need to be described in WKT String
      “properties" : {
    // the data of the attribute of 'cellspaceGeometry' will be described at here
    // the identifier of the geometry feature
         “id" : “cg1"
      }
   },
   “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"
   }
}