A visualizer of the "spatial network model for pedestrians"
This project has two tools to visualize the "spatial network model for pedestrians1".
- data_importer
- First, dim fetches the "spatial network model for pedestrians" data (Node csv and Link csv) from open data APIs.
- Once a data fetch process is complete, dim will launch this preprocess command as a docker container automatically.
- The launched container imports the fetched data into FIWARE.
- graph_viewer
- Once both the Node csv and Link csv have been imported into FIWARE, you can visualize the graph of patial network model for pedestrians like below:
- Render all nodes and links.
- Render all nodes, but render only walkways that wheelchairs and robots can easily pass through (widths of 3m or more and gentle slopes).
- Get and install dim
- Clone this repository.
» git clone https://github.com/nmatsui/dim_pedestrian_walkway_graph.git » cd ./dim_pedestrian_walkway_graph
- Start FIWARE orion as a docker container and make sure it starts correctly.
dim_pedestrian_walkway_graph - [main] » cd fiware dim_pedestrian_walkway_graph/fiware - [main] » docker compose up -d dim_pedestrian_walkway_graph/fiware - [main] » curl -v http://<<your ip address>>:1026/v2/entities/ ... < HTTP/1.1 200 OK ... []* Closing connection 0 dim_pedestrian_walkway_graph/fiware - [main] » cd ..
- Set the ip address of FIWARE orion.
(The following command is an example when the IP address of your PC is 192.168.10.10.)dim_pedestrian_walkway_graph - [main] » cd data_importer dim_pedestrian_walkway_graph/data_importer - [main] » sed -e 's/<<your_ip_address>>/192.168.10.10/g' config/fiware_config.json.tmpl > config/fiware_config.json
- Build a docker container importing data to FIWARE orion.
dim_pedestrian_walkway_graph/data_importer - [main●] » cd preprocess_command data_importer/preprocess_command - [main] » docker build -t data_importer:0.1.0 . data_importer/preprocess_command - [main] » cd ..
- Fetch data and import them into FIWARE orion by using dim.
dim_pedestrian_walkway_graph/data_importer - [main●] » dim install
- Confirm imported data.
dim_pedestrian_walkway_graph/data_importer - [main●] » curl -sS -H "fiware-service: pedestrian_walkway_graph" -H "fiware-servicepath:/fukushima/aizuwakamatsu" "http://192.168.10.10:1026/v2/entities/?type=Node&limit=2" | jq . [ { "id": "305258", "type": "Node", "floor": { "type": "number", "value": 0, "metadata": {} }, "in_out": { "type": "integer", "value": 1, "metadata": {} }, "lat": { "type": "number", "value": 37.4915265, "metadata": {} }, "lon": { "type": "number", "value": 139.9286769, "metadata": {} } }, { "id": "305257", "type": "Node", ... ] dim_pedestrian_walkway_graph/data_importer - [main●] » curl -sS -H "fiware-service: pedestrian_walkway_graph" -H "fiware-servicepath:/fukushima/aizuwakamatsu" "http://192.168.10.10:1026/v2/entities/?type=Link&limit=2" | jq . [ { "id": "322656", "type": "Link", "brail_tile": { "type": "integer", "value": "1", "metadata": {} }, "direction": { "type": "integer", "value": "1", "metadata": {} }, "end_id": { "type": "string", "value": "305257", "metadata": {} }, ... ] dim_pedestrian_walkway_graph/data_importer - [main●] » cd ..
- Set the ip address of FIWARE orion.
(The following command is an example when the IP address of your PC is 192.168.10.10.)dim_pedestrian_walkway_graph - [main●] » cd graph_viewer dim_pedestrian_walkway_graph/graph_viewer - [main] » sed -e 's/<<your_ip_address>>/192.168.10.10/g' config/viewer_config.json.tmpl > config/viewer_config.json
- Build a docker container rendering data retrieved from FIWARE orion.
dim_pedestrian_walkway_graph/graph_viewer - [main●] » docker build -t graph_viewer:0.1.0 .
- Render graph
dim_pedestrian_walkway_graph/graph_viewer - [main●] » docker run -it -v $(pwd)/config:/opt/config -v $(pwd)/dist:/opt/dist graph_viewer:0.1.0 -c /opt/config/viewer_config.json -s all /opt/dist/map_all.png
- You can set
all
,class1
,class2
andclass3
as-s
option. - Each class represents a decision logic to connect sidewalks. See strategies.py for more details.
- You can set
Copyright (c) 2022, Nobuyuki Matsui