Undirected graph network with latitude and longitude as node
1 回表示 (過去 30 日間)
古いコメントを表示
Is there any way to plot graph structure describing nodes, edges and links but with latitude and logitude as the co-ordinates using MATLAB, like the one describe here:
0 件のコメント
採用された回答
Steven Lord
2019 年 7 月 21 日
See this post on Loren Shure's blog for an example that plots US states (as polyshape objects) along with their centroids (as nodes of a graph, with two centroids connected by an edge if the states they represent share a border.) The latitude and longitude data comes from a shapefile included in Mapping Toolbox.
If you had coordinates for the capitals of those states, you could store that data in the Nodes table of the graph as custom attributes and use those as the X and Y data (and Z data, I suppose, though that may not be so useful) when you call plot on the graph.
2 件のコメント
Steven Lord
2019 年 7 月 21 日
In that example, the polyshape objects representing the state boundaries and the graph object representing the state centroids are independent MATLAB objects. The only relation between them is that their coordinates are both latitude and longitude values so they represent areas in the same section of the map.
If you wanted to create a graph that represents the board for the game Ticket to Ride you could do so. I've done this. [You'd want to use release R2018a or later for this, as the board is a multigraph.]
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!