indoorjson3 serialization and desrialization library writen in c++14
A experimental project tring to redesign IndoorGML concept to make it easy to use. And add transport system support.
{
"properties": {
"name": "indoorjson3-cpp",
"labels": ["indoorgml", "GIS"],
"language": ["English", "中文", "한국어"],
"author": {
"name": "Kunlin Yu",
"email": "[email protected]"
}
},
"cells": [
{
"$id": "c1",
"properties": {"roomNumber": "1101"},
"space": "POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))",
"node": "POINT (0.5 0.5)"
},
{
"$id": "c2",
"properties": {"roomNumber": "1102"},
"space": "POLYGON ((1 0, 2 0, 2 1, 1 1, 1 0))",
"node": "POINT (1.5 0.5)"
},
{
"$id": "c3",
"properties": {"roomNumber": "1103"},
"space": "POLYGON ((0 1, 1 1, 1 2, 0 2, 0 1))",
"node": "POINT (0.5 1.5)"
}
],
"connections": [
{
"$id": "conn1-2",
"properties": {
"type": "door",
"开放时间": "全天",
"오픈 시간": "하루 종일"
},
"fr": "c1",
"to": "c2",
"bound": "LINESTRING (1 0, 1 1)",
"edge": "LINESTRING (0.5 0.5, 1.5 0.5)"
},
{
"$id": "conn3-1",
"properties": {"type": "window"},
"fr": "c3",
"to": "c1",
"bound": "LINESTRING (1 0, 1 1)",
"edge": "LINESTRING (0.5 0.5, 1.5 0.5)"
}
],
"layers": [
{
"$id": "layer",
"cells": ["c1", "c2"]
}
],
"rlineses": [
{
"$id": "rlines1",
"cell": "c1",
"ins": ["conn3-1"],
"outs": ["conn1-2"],
"closure": []
}
]
}
We use json-schema-validator to define and validate the json string which uses nlohmann/json
We use libgeos to represent the Geometry of CellSpace and CellBoundary.
for logging
for unit tests.
- install using apt
sudo apt install libglog
sudo apt install libgoogle-glog-dev
sudo apt install libgtest-dev
sudo apt install nlohmann-json3-dev
-
install from source code
- json-schema-validator
No apt sources are available for it, so we need to build it from source code
git clone https://github.com/pboettch/json-schema-validator.git cd json-schema-validator mkdir build cd build cmake .. make -j16 make install
- libgeos
The default libgeos version of Ubuntu 22.04 is libgeos 3.10.2 which is not stable enough so we better build if from the source code.
git clone https://github.com/libgeos/geos.git cd geos git checkout 3.12.0 mkdir build cd build cmake .. -DBUILD_TESTING=OFF make -j16 sudo make install
-
build indoorjson3-cpp
cd indoorjson3-cpp
mkdir build
cd build
cmake ..
make -j16
-
Install conan first https://conan.io/downloads
-
Use conan to prepare the dependencies and generate cmake files in "build" directory.
conan install . --output-folder=build --build=missing
- Then use cmake to configure.
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
- Finally trigger build using make.
make -j16
-
Install conan first https://conan.io/downloads
-
Use conan to prepare the dependencies and generate cmake files in "out/build" directory.
conan install . --output-folder=out/build --build=missing
-
Open indoorjson3-cpp directory using Visual Studio
-
Set CMakeSettings.json
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeToolchain": "${projectDir}\\out\\build\\conan_toolchain.cmake",
- Finally trigger configuration and building using VS GUI.