Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[NetworkGraph] Geographic information for nodes and links #62

Open
nemesifier opened this issue May 8, 2018 · 0 comments
Open

[NetworkGraph] Geographic information for nodes and links #62

nemesifier opened this issue May 8, 2018 · 0 comments

Comments

@nemesifier
Copy link
Member

nemesifier commented May 8, 2018

Many people have asked for a way to show geographic coordinates in NetJSON.
The best approach in my opinion is to reuse the GeoJSON conventions, eg, using a geometry attribute:

{
    "type": "NetworkGraph",
    "protocol": "olsr",
    "version": "0.6.6",
    "metric": "etx",
    "router_id": "172.16.40.24",
    "label": "Test Network",
    "nodes": [
        {
            "id": "172.16.40.24",
            "label": "node A",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    13.7457753718,
                    43.2589744573
                ]
            },
            "properties": {
                "hostname": "node1.my.net"
            }
        },
        {
            "id": "172.16.40.60",
            "label": "node B",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    13.7571653724,
                    43.2600585598
                ]
            },
            "properties": {
                "hostname": "node2.my.net"
            }
        }
    ],
    "links": [
        {
            "source": "172.16.40.24",
            "target": "172.16.40.60",
            "cost": 1.000,
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        13.7457753718,
                        43.2589744573
                    ],
                    [
                        13.7571653724,
                        43.2600585598
                    ]
                ]
            }
        }
    ]
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant