How can I convert shapefiles to graph

5 views (last 30 days)
Meshaiel M
Meshaiel M on 29 Apr 2016
Commented: Meshaiel M on 30 Apr 2016
I want to convert a .shp file or GIS data for (road network) to graph, so I can calculate the shortest path
Thank you..

Answers (1)

Kelly Kearney
Kelly Kearney on 29 Apr 2016
A few questions:
  • Do you have the Mapping Toolobx? If so, look at shaperead to read the file in.
  • What version of Matlab are you running? If it 2015b or beyond, the new graph objects and their related methods (including a few shortest path algorithms) will help.
The process of converting from shapefile data to graph object will depend on exactly what data is in the shapefiles. Are the road endpoints and intersection points (nodes) already known? Are the lengths of each road segment known? Or are you simply starting with road coordinates, with all this detail (and possibly the connectivity) needing to be calculated?
  1 Comment
Meshaiel M
Meshaiel M on 30 Apr 2016
yes I have Mapping Toolobx and I use shaperead to read the file to Geometry X Y type of data is struc
I have R2016a version

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!