Skip to content

[NetworkGraph] Geographic information for nodes and links #62

Open
@nemesifier

Description

@nemesifier

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
                    ]
                ]
            }
        }
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions