SIMoN Granularity Graph Tool
Build granularity graphs used for data translation in the SIMoN software application.
Copyright 2020 The Johns Hopkins University Applied Physics Laboratory Licensed under the MIT License
Description
This tool uses shapefiles to generate two JSON graphs: an abstract graph and an instance graph.
To use the generated graphs, rename the abstract graph to abstract-graph.geojson, and the instance graph to instance-graph.geojson.
Then place these two files in the graphs/ directory so that SIMoN will use them.
Both JSON graphs have 3 key attributes:
nodesmaps to a list of the graph's verticeslinksmaps to a list of the graph's edgesgraphmaps to a dictionary of the graph's metadataidis a UUID for the abstract-instance graph pair, that both the abstract graph and the corresponding instance graph shareprojectionis the coordinate reference system that the shapefile geometries are defined ongranularitiesare the granularities that the graphs connectmin_intersect_areais the minimum area of a wedge node in the instance graph (a node made by intersecting disparate geographic granularities)nodesis the number of vertices in the graphlinksis the number of edges in the graphcountsis the number of vertices in the graph, categorized by granularityareasis the total area of each granularity's scope, that is, the sum of all the node areas of each granularity. Ideally, these areas should be equal so that the graph will have a consistent scope.
Installation
Use Python 3.6 to run the graph construction tools.
-
install
libspatialindexa. install
make,cmake, and a compiler (g++orgcc)c.
tar xfvz spatialindex-src-1.9.3.tar.gzd.
cd spatialindex-src-1.9.3e.
cmake -DCMAKE_INSTALL_PREFIX=/home/username .f.
makeg.
make install -
install Python packages
a.
pip install -r requirements.txt -
test installation
a.
export LD_LIBRARY_PATH=/home/username/libb.
python test_installation.py